checkrecord2.js 30 KB

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