checkrecord2.js 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875
  1. /**
  2. * checkrecord2.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/XjSpotOperationRecordExcel",
  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/getList',
  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/getJlPointsList',
  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('maintenanceCheck_title2_input').value;
  187. var person_liable_id = document.getElementById('maintenanceCheck_title3_input1').value;
  188. var data3b = document.getElementById('maintenanceCheck_title3_input2').value;
  189. var data3a = document.getElementById('maintenanceCheck_title3_input3').value;
  190. var zt = document.getElementById('maintenanceCheck_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('MaintenanceCheckListPageToolbar').moveFirst();
  219. }
  220. var reset1 = function(){
  221. document.getElementById('maintenanceCheck_title2_input').value = '';
  222. document.getElementById('maintenanceCheck_title3_input1').value = '';
  223. document.getElementById('maintenanceCheck_title3_input2').value = '';
  224. document.getElementById('maintenanceCheck_title3_input3').value = '';
  225. document.getElementById('maintenanceCheck_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 = "maintenanceCheck_";
  240. for(var i=1;i<4;i++){
  241. var id = "maintenanceCheck_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=='maintenanceCheck_title1_div'){
  264. menuidx = 'm1';
  265. show_page();
  266. }
  267. else if(id=='maintenanceCheck_title2_div'){
  268. menuidx = 'm2';
  269. reset1();
  270. }
  271. else if(id=='maintenanceCheck_title3_div'){
  272. menuidx = 'm3';
  273. exportbtn_click();
  274. }
  275. }
  276. var maintenancedevice = function(){
  277. var maintenance_look_device = document.getElementById('maintenanceCheck_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:'maintenanceCheck_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('maintenanceCheck_data_win1').destroy();
  303. }
  304. }
  305. ],
  306. closeAction:'destroy',
  307. html:'<div id="maintenanceCheck_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/getList",
  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('maintenanceCheck_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:'maintenanceCheck_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('maintenanceCheck_Presentation_win1').destroy();
  352. }
  353. }
  354. ],
  355. closeAction:'destroy',
  356. html:'<div id="maintenanceCheck_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/getJlPointsList",
  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('MaintenanceCheckListPageToolbar1').moveFirst();
  392. }
  393. var MaintenanceCheckPanel1 =Ext.create('Ext.grid.Panel', {
  394. header :{
  395. height:0,
  396. border:'0px solid #000000'
  397. },
  398. id: 'MaintenanceCheckListPanel1',
  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:'MaintenanceCheckListPageToolbar1',
  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 maintenanceCheckHtml2 =function(){
  467. // var maintenanceCheckHtml21 = document.getElementById('maintenanceCheckHtml2');
  468. // var title = document.createElement('div');
  469. // title.setAttribute('class','MaintenanceCheckTitle');
  470. // title.innerHTML='维保状态:';
  471. // maintenanceCheckHtml21.appendChild(title);
  472. // var select = document.createElement('select');
  473. // select.setAttribute('class','Check_select_class');
  474. // select.setAttribute('onchange',"changeon(this)");
  475. // maintenanceCheckHtml21.appendChild(select);
  476. // var option3 = document.createElement('option');
  477. // option3.innerHTML='所有';
  478. // option3.setAttribute('value','0');
  479. // select.appendChild(option3);
  480. // var option1 = document.createElement('option');
  481. // option1.innerHTML='未完成';
  482. // option1.setAttribute('value','1');
  483. // select.appendChild(option1);
  484. // var option2 = document.createElement('option');
  485. // option2.innerHTML='已完成';
  486. // option2.setAttribute('value','2');
  487. // select.appendChild(option2);
  488. // }
  489. var childPanel3 = Ext.create('Ext.Panel', {
  490. height:50,
  491. width:'100%',
  492. 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>'
  493. });
  494. var piebar2 = Ext.create('Ext.panel.Panel',{
  495. id:'maintenanceCheckHtml2',
  496. width:'100%',
  497. height:50,
  498. region:'north',
  499. layout:'form',
  500. defaults:{
  501. border:false
  502. },
  503. items: [childPanel3]
  504. });
  505. var modifywin = function(id){
  506. Ext.create('Ext.window.Window', {
  507. title: '维保点位',
  508. height: 500,
  509. width: 800,
  510. modal: true,
  511. layout:'border',
  512. items: [ piebar2,MaintenanceCheckPanel1],
  513. buttons:[
  514. {
  515. text:'关闭',
  516. handler : function() {
  517. this.up('window').hide();
  518. }
  519. }
  520. ],
  521. closeAction: 'hide'
  522. }).show();
  523. }
  524. var piedarHtml2 = function() {
  525. var date=new Date;
  526. var dates=Ext.util.Format.date(date, 'Y-m-d');
  527. var preDate = new Date(date.getTime() - 24*60*60*1000);
  528. var dates2=Ext.util.Format.date(preDate, 'Y-m-d');
  529. var maintenanceCheckHtml = document.getElementById('maintenanceCheckHtml');
  530. var divhiddle = document.createElement('div');
  531. divhiddle.id='div26_id_checkrecord2Panel3';
  532. divhiddle.setAttribute('class','SpringHandleHtml3DivHiddle');
  533. maintenanceCheckHtml.appendChild(divhiddle);
  534. var title = document.createElement('div');
  535. title.setAttribute('class','MaintenancePersonTitle');
  536. title.innerHTML='维保记录';
  537. maintenanceCheckHtml.appendChild(title);
  538. var title2 = document.createElement('div');
  539. title2.setAttribute('class','Check_title2_div');
  540. title2.innerHTML='任务名称';
  541. maintenanceCheckHtml.appendChild(title2);
  542. var input = document.createElement('input');
  543. input.setAttribute('class','Check_input_class');
  544. input.setAttribute('id','maintenanceCheck_title2_input');
  545. input.setAttribute('type','text');
  546. input.setAttribute('value','');
  547. maintenanceCheckHtml.appendChild(input);
  548. var title3 = document.createElement('div');
  549. title3.setAttribute('class','Check_title3_div');
  550. title3.innerHTML='责任人';
  551. maintenanceCheckHtml.appendChild(title3);
  552. // var input1 = document.createElement('input');
  553. // input1.setAttribute('class','Check_input1_class');
  554. // input1.setAttribute('id','maintenanceCheck_title3_input1');
  555. // input1.setAttribute('type','text');
  556. // input1.setAttribute('value','');
  557. // maintenanceCheckHtml.appendChild(input1);
  558. var select = document.createElement('select');
  559. select.setAttribute('class','Check_input1_class');
  560. select.setAttribute('id','maintenanceCheck_title3_input1');
  561. maintenanceCheckHtml.appendChild(select);
  562. var option2 = document.createElement('option');
  563. option2.innerHTML='所有人';
  564. option2.setAttribute('value','0');
  565. select.appendChild(option2);
  566. for(var i=0;i<ConfirmStore1.length;i++){
  567. var option3 = document.createElement('option');
  568. option3.innerHTML=ConfirmStore1[i].name;
  569. option3.setAttribute('value',ConfirmStore1[i].person_liable_id);
  570. select.appendChild(option3);
  571. }
  572. var title4 = document.createElement('div');
  573. title4.setAttribute('class','maintenanceCheck_title1_div');
  574. title4.setAttribute('id','maintenanceCheck_title1_div');
  575. title4.setAttribute('onmouseover',"mouseon(this)");
  576. title4.setAttribute('onmouseout',"mouseoff(this)");
  577. title4.setAttribute('onclick',"menu_click(this)");
  578. maintenanceCheckHtml.appendChild(title4);
  579. var title5 = document.createElement('div');
  580. title5.setAttribute('class','maintenanceCheck_title2_div');
  581. title5.setAttribute('id','maintenanceCheck_title2_div');
  582. title5.setAttribute('onmouseover',"mouseon(this)");
  583. title5.setAttribute('onmouseout',"mouseoff(this)");
  584. title5.setAttribute('onclick',"menu_click(this)");
  585. maintenanceCheckHtml.appendChild(title5);
  586. var title6 = document.createElement('div');
  587. title6.setAttribute('class','maintenanceCheck_title3_div');
  588. title6.setAttribute('id','maintenanceCheck_title3_div');
  589. title6.setAttribute('onmouseover',"mouseon(this)");
  590. title6.setAttribute('onmouseout',"mouseoff(this)");
  591. title6.setAttribute('onclick',"menu_click(this)");
  592. maintenanceCheckHtml.appendChild(title6);
  593. var input2 = document.createElement('input');
  594. input2.setAttribute('class','Check_input2_class');
  595. input2.setAttribute('id','maintenanceCheck_title3_input2');
  596. input2.setAttribute('type','text');
  597. input2.setAttribute('readonly','true');
  598. input2.setAttribute('value',dates);
  599. maintenanceCheckHtml.appendChild(input2);
  600. // laydate.render({
  601. // elem: '#maintenanceCheck_title3_input2' //指定元素
  602. //
  603. // });
  604. var title8 = document.createElement('div');
  605. title8.setAttribute('class','Check_title8_div');
  606. title8.innerHTML='~';
  607. maintenanceCheckHtml.appendChild(title8);
  608. var input3 = document.createElement('input');
  609. input3.setAttribute('class','Check_input3_class');
  610. input3.setAttribute('id','maintenanceCheck_title3_input3');
  611. input3.setAttribute('type','text');
  612. input3.setAttribute('readonly','true');
  613. input3.setAttribute('value',dates2);
  614. maintenanceCheckHtml.appendChild(input3);
  615. //设置开始时间
  616. var startDate = laydate.render({
  617. elem: '#maintenanceCheck_title3_input3',
  618. done: function (value, date) {
  619. if (value !== '') {
  620. endDate.config.min.year = date.year;
  621. endDate.config.min.month = date.month - 1;
  622. endDate.config.min.date = date.date;
  623. } else {
  624. endDate.config.min.year = '';
  625. endDate.config.min.month = '';
  626. endDate.config.min.date = '';
  627. }
  628. }
  629. });
  630. //设置结束时间
  631. var endDate = laydate.render({
  632. elem: '#maintenanceCheck_title3_input2',
  633. done: function (value, date) {
  634. if (value !== '') {
  635. startDate.config.max.year = date.year;
  636. startDate.config.max.month = date.month - 1;
  637. startDate.config.max.date = date.date;
  638. } else {
  639. startDate.config.max.year = '';
  640. startDate.config.max.month = '';
  641. startDate.config.max.date = '';
  642. }
  643. }
  644. });
  645. var title7 = document.createElement('div');
  646. title7.setAttribute('class','Check_title7_div');
  647. title7.innerHTML='完成时间';
  648. maintenanceCheckHtml.appendChild(title7);
  649. // var input4 = document.createElement('input');
  650. // input4.setAttribute('class','Check_input4_class');
  651. // input4.setAttribute('id','maintenanceCheck_title3_input4');
  652. // input4.setAttribute('type','text');
  653. // input4.setAttribute('value','');
  654. // maintenanceCheckHtml.appendChild(input4);
  655. var select1 = document.createElement('select');
  656. select1.setAttribute('class','Check_input4_class');
  657. select1.setAttribute('id','maintenanceCheck_title3_input4');
  658. maintenanceCheckHtml.appendChild(select1);
  659. var option3 = document.createElement('option');
  660. option3.innerHTML='所有';
  661. option3.setAttribute('value','4');
  662. select1.appendChild(option3);
  663. var option1 = document.createElement('option');
  664. option1.innerHTML='未开始';
  665. option1.setAttribute('value','0');
  666. select1.appendChild(option1);
  667. var option2 = document.createElement('option');
  668. option2.innerHTML='进行中';
  669. option2.setAttribute('value','1');
  670. select1.appendChild(option2);
  671. var option3 = document.createElement('option');
  672. option3.innerHTML='完成';
  673. option3.setAttribute('value','3');
  674. select1.appendChild(option3);
  675. var option4 = document.createElement('option');
  676. option4.innerHTML='超时';
  677. option4.setAttribute('value','2');
  678. select1.appendChild(option4);
  679. var title9 = document.createElement('div');
  680. title9.setAttribute('class','Check_title9_div');
  681. title9.innerHTML='任务状态';
  682. maintenanceCheckHtml.appendChild(title9);
  683. var title10 = document.createElement('div');
  684. title10.setAttribute('class','maintenanceCheck_title10_div');
  685. maintenanceCheckHtml.appendChild(title10);
  686. var title11 = document.createElement('div');
  687. title11.setAttribute('class','maintenanceCheck_title11_div');
  688. maintenanceCheckHtml.appendChild(title11);
  689. var title12 = document.createElement('div');
  690. title12.setAttribute('class','maintenanceCheck_title12_div');
  691. maintenanceCheckHtml.appendChild(title12);
  692. var title13 = document.createElement('div');
  693. title13.setAttribute('class','maintenanceCheck_title13_div');
  694. maintenanceCheckHtml.appendChild(title13);
  695. var title14 = document.createElement('div');
  696. title14.setAttribute('class','Check_title14_div');
  697. title14.innerHTML=jrwcrw;
  698. maintenanceCheckHtml.appendChild(title14);
  699. var title15 = document.createElement('div');
  700. title15.setAttribute('class','Check_title15_div');
  701. title15.innerHTML=csrw;
  702. maintenanceCheckHtml.appendChild(title15);
  703. var title16 = document.createElement('div');
  704. title16.setAttribute('class','Check_title16_div');
  705. title16.innerHTML=jrrw;
  706. maintenanceCheckHtml.appendChild(title16);
  707. var title17 = document.createElement('div');
  708. title17.setAttribute('class','Check_title17_div');
  709. title17.innerHTML=xjrysl;
  710. maintenanceCheckHtml.appendChild(title17);
  711. }
  712. var piedarHtml = function() {
  713. var query = new Object();
  714. query.V_LOGINNAME = $("#V_LOGINNAME").val();
  715. pieMask.show();
  716. $.ajax({
  717. type:'POST',
  718. url: baseUrl+"iot/spotoperationrecord/getList3",
  719. data: {
  720. queryJson : Ext.JSON.encode(query)
  721. },
  722. success: function(result){
  723. var json = eval('(' + result + ')');
  724. if(json.action=='getSpotOperationRecordList3'){
  725. // ConfirmStore = json.RESULT;
  726. ConfirmStore1 = json.RESULT1;
  727. xjrysl = json.xjrysl;
  728. jrwcrw = json.jrwcrw;
  729. csrw = json.csrw;
  730. jrrw = json.jrrw;
  731. piedarHtml2();
  732. }
  733. pieMask.hide();
  734. }
  735. });
  736. }
  737. var MaintenanceCheckListPanel=Ext.create('Ext.grid.Panel', {
  738. header :{
  739. height:0,
  740. border:'0px solid #000000'
  741. },
  742. id: 'MaintenanceCheckListPanel',
  743. store: myStore,
  744. selModel: sm,
  745. columns: [
  746. { header: 'ID', dataIndex: 'id',hidden:true, menuDisabled:true },
  747. { header: '序号', dataIndex: 'xh', width:77, menuDisabled:true },
  748. { header: '任务名称', dataIndex: 'plan_name', width:250,align:'center', menuDisabled:true },
  749. {
  750. text:'维保点位',
  751. xtype : 'actioncolumn',
  752. width:140,
  753. sortable:false,
  754. align:'center',
  755. menuDisabled:true,
  756. items:[{
  757. icon: '../../res/img/common/chakanbtn.png',
  758. tooltip: '维保点位',
  759. handler: function(grid, rowIndex, colIndex) {
  760. var rec = grid.getStore().getAt(rowIndex);
  761. $("#checkRecord_id").val(rec.get("id"));
  762. modifywin(rec.get("id"));
  763. var label = rec.get("id");
  764. var query = new Object();
  765. // alert(label);
  766. if(label.length>0){
  767. query.id = label;
  768. }
  769. query.V_LOGINNAME = V_LOGINNAME;
  770. // query.V_PASSWORD = V_PASSWORD;
  771. var jsonstr = Ext.JSON.encode(query);
  772. myStore1.getProxy().extraParams = {
  773. queryJson : jsonstr
  774. };
  775. myStore1.reload();
  776. }
  777. }]
  778. },
  779. { header: '应完成时间', dataIndex: 'ywcsj', width:250,align:'center', menuDisabled:true },
  780. { header: '当前状态', dataIndex: 'zt',width:120, align:'center', menuDisabled:true },
  781. { header: '完成情况(%)', dataIndex: 'completion', width:120, align:'center', menuDisabled:true },
  782. { header: '实际完成时间', dataIndex: 'data3', width:240, align:'center', menuDisabled:true },
  783. { header: '相关责任人', dataIndex: 'name', width:100, align:'center', menuDisabled:true },
  784. { header: '联系电话', dataIndex: 'phone', width:140, align:'center', menuDisabled:true },
  785. ],
  786. columnLines: true,
  787. height: maxHeight,
  788. width: '100%',
  789. bbar: new Ext.PagingToolbar({
  790. store: myStore,
  791. id:'MaintenanceCheckListPageToolbar',
  792. displayInfo: true,
  793. pageSize: countPerPage,
  794. prependButtons: true,
  795. displayMsg : '显示第 {0}条到 {1}条记录,总共 {2}条',
  796. emptyMsg : "没有记录",
  797. firstText: '第一页',
  798. prevText: '前一页',
  799. nextText: '后一页',
  800. lastText: '最后一页',
  801. refreshText: '刷新',
  802. }),
  803. border:false,
  804. iconCls: 'icon-grid'
  805. });
  806. var piebar = Ext.create('Ext.panel.Panel',{
  807. id:'maintenanceCheckHtml',
  808. width:'100%',
  809. height:250,
  810. region:'north',
  811. layout:'form',
  812. defaults:{
  813. border:false
  814. }
  815. });
  816. pieMask = new Ext.LoadMask(piebar,{msg:"Loading..."});
  817. new Ext.create('Ext.panel.Panel',{
  818. width:'100%',
  819. id: 'MaintenanceCheckPiebar',
  820. layout:'border',
  821. items:[
  822. piebar,MaintenanceCheckListPanel
  823. ],
  824. renderTo: Ext.getBody()
  825. });
  826. myStore.reload();
  827. myStore.addListener('load',function(store,record,opts){
  828. if(document.getElementById('div26_id_checkrecord2Panel3')==undefined)
  829. piedarHtml();
  830. });
  831. maxHeight = document.documentElement.clientHeight;
  832. Ext.getCmp('MaintenanceCheckPiebar').setHeight(maxHeight);
  833. });