patrolplan.js 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707
  1. /**
  2. * patrolplan.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 sm = Ext.create('Ext.selection.CheckboxModel');
  18. Ext.define('PatrolPlan',{
  19. extend: 'Ext.data.Model',
  20. fields: [
  21. {name:'id', type:'string'},
  22. {name:'personnel', type:'string'},
  23. {name:'route', type:'string'},
  24. {name:'planned_date', type:'string'},
  25. {name:'start_time', type:'string'},
  26. {name:'end_time', type:'string'},
  27. {name:'completion_status', type:'string'},
  28. ]
  29. });
  30. Ext.onReady(function(){
  31. var baseUrl = document.getElementById('basePath').value;
  32. var theme = document.getElementById('theme').value;
  33. company_code = document.getElementById('company_code').value;
  34. V_LOGINNAME = $("#V_LOGINNAME").val();
  35. V_PASSWORD = $("#V_PASSWORD").val();
  36. var chkIcon = '<img src="'+baseUrl+'res/img/common/check.gif"/>'
  37. var unchkIcon = '<img src="'+baseUrl+'res/img/common/uncheck.gif"/>'
  38. var countPerPage = 20;
  39. var maxHeight = 10000;
  40. var chkBoolean = function(flag) {
  41. if(flag)
  42. return chkIcon;
  43. return unchkIcon;
  44. }
  45. var states1 = Ext.create('Ext.data.Store', {
  46. fields: ['status', 'name'],
  47. data : [
  48. // {"status":-1, "name":"全选"},
  49. {"status":"待开通", "name":"待开通"},
  50. {"status":"已开通", "name":"已开通"},
  51. {"status":"已锁定", "name":"已锁定"},
  52. {"status":"注销", "name":"注销"},
  53. ]
  54. });
  55. var clear_append_form = function (){
  56. Ext.getCmp('fa_personnel').setValue("");
  57. Ext.getCmp('fa_route').setValue("");
  58. // Ext.getCmp('fa_planned_date').setValue("");
  59. Ext.getCmp('fa_start_data').setValue("");
  60. Ext.getCmp('fa_end_data').setValue("");
  61. Ext.getCmp('fa_start_time').setValue("");
  62. Ext.getCmp('fa_end_time').setValue("");
  63. Ext.getCmp('fa_completion_status').setValue("");
  64. Ext.getCmp('PatrolPlanListPanel').getStore().reload();
  65. }
  66. var queryJson = new Object();
  67. queryJson.V_LOGINNAME = V_LOGINNAME;
  68. queryJson.V_PASSWORD = V_PASSWORD;
  69. queryJson.COMMSTATUS = 'NO';
  70. if((company_code!=null)&&(company_code!='null')&&(company_code.length>0))
  71. queryJson.company_code = company_code;
  72. var myStore = Ext.create('Ext.data.Store', {
  73. model: 'PatrolPlan',
  74. pageSize: countPerPage,
  75. proxy: {
  76. type: 'ajax',
  77. url: baseUrl+'iot/patrolplan/getList',
  78. reader: {
  79. type: 'json',
  80. root: 'RESULT',
  81. totalProperty: 'totalCount'
  82. },
  83. extraParams:{
  84. queryJson:Ext.JSON.encode(queryJson)
  85. }
  86. },
  87. remoteSort: true
  88. });
  89. Ext.define('CompanyComboStore',{
  90. extend:'Ext.data.Model',
  91. fields: [
  92. {name:'name', type:'string'},
  93. {name:'id',type:'int'}
  94. ]
  95. });
  96. Ext.define('RouteComboStore',{
  97. extend:'Ext.data.Model',
  98. fields: [
  99. {name:'route_name', type:'string'},
  100. {name:'id',type:'int'}
  101. ]
  102. });
  103. var queryJson = new Object();
  104. var InspectorsStory = Ext.create('Ext.data.Store',{
  105. model: 'CompanyComboStore',
  106. proxy: {
  107. type: 'ajax',
  108. actionMethods: {
  109. create : 'POST',
  110. read : 'POST', // by default GET
  111. update : 'POST',
  112. destroy: 'POST'
  113. },
  114. url: baseUrl+'iot/inspectors/getList',
  115. reader: {
  116. type: 'json',
  117. root: 'RESULT',
  118. totalProperty: 'totalCount'
  119. },
  120. extraParams:{
  121. queryJson:Ext.JSON.encode(queryJson)
  122. }
  123. }
  124. });
  125. var RouteStory = Ext.create('Ext.data.Store',{
  126. model: 'RouteComboStore',
  127. proxy: {
  128. type: 'ajax',
  129. actionMethods: {
  130. create : 'POST',
  131. read : 'POST', // by default GET
  132. update : 'POST',
  133. destroy: 'POST'
  134. },
  135. url: baseUrl+'iot/route/getList',
  136. reader: {
  137. type: 'json',
  138. root: 'RESULT',
  139. totalProperty: 'totalCount'
  140. },
  141. extraParams:{
  142. queryJson:Ext.JSON.encode(queryJson)
  143. }
  144. }
  145. });
  146. var data =Ext.Date.format(new Date(), 'm/d/Y');
  147. var AppendForm = Ext.create('Ext.form.Panel', {
  148. id: 'PatrolPlanAppendForm',
  149. labelWidth: 55,
  150. url: baseUrl+'iot/patrolplan/append',
  151. defaultType: 'textfield',
  152. bodyPadding: 15,
  153. items: [{
  154. xtype:'combo',
  155. fieldLabel:'巡检人名称',
  156. id: 'fa_personnel',
  157. name:'xj_name',
  158. displayField : 'name',
  159. valueField : 'id',
  160. editable : false,
  161. width:283,
  162. store:InspectorsStory
  163. },{
  164. // fieldLabel:'巡检路线',
  165. // id: 'fa_route',
  166. // name: 'route',
  167. // maxLength: 250,
  168. // maxLengthText:'长度不得超出{0}',
  169. // anchor:'80%'
  170. xtype:'combo',
  171. fieldLabel:'巡检路线',
  172. id: 'fa_route',
  173. name:'route',
  174. displayField : 'route_name',
  175. valueField : 'id',
  176. editable : false,
  177. width:283,
  178. store:RouteStory
  179. },{
  180. xtype:'timefield',
  181. fieldLabel:'开始时间',
  182. id: 'fa_start_time',
  183. name:"start_time",
  184. minValue:'9:00',
  185. maxValue:'18:00',
  186. minText:'时间要大于{0}',
  187. maxText:'时间要小于{0}',
  188. format:'G:i',//时间格式G(24小时进制)、i、s(时分秒,g是12小时进制)
  189. increment:30,//跨度,默认是15分钟
  190. invalidText:'时间格式错误',
  191. anchor:'80%'
  192. },{
  193. xtype:'timefield',
  194. fieldLabel:'结束时间',
  195. id: 'fa_end_time',
  196. name:"end_time",
  197. minValue:'9:00',
  198. maxValue:'18:00',
  199. minText:'时间要大于{0}',
  200. maxText:'时间要小于{0}',
  201. format:'G:i',//时间格式G(24小时进制)、i、s(时分秒,g是12小时进制)
  202. increment:30,//跨度,默认是15分钟
  203. invalidText:'时间格式错误',
  204. anchor:'80%'
  205. },{
  206. xtype: 'checkboxgroup',
  207. fieldLabel: '巡检时间',
  208. id:"Inspectiontime",
  209. columns: 3,
  210. items: [
  211. {boxLabel: '周一', name: 'monday',inputValue:"星期一"},
  212. {boxLabel: '周二', name: 'tuesday',inputValue:"星期二"},
  213. {boxLabel: '周三', name: 'wednesday',inputValue:"星期三"},
  214. {boxLabel: '周四', name: 'thursday',inputValue:"星期四"},
  215. {boxLabel: '周五', name: 'friday',inputValue:"星期五"},
  216. {boxLabel: '周六', name: 'saturday',inputValue:"星期六"},
  217. {boxLabel: '周日', name: 'sunday',inputValue:"星期日"}
  218. ]},{
  219. xtype:'datefield',
  220. fieldLabel:"开始日期",
  221. minValue:data,
  222. // '07/07/2017',
  223. minText:"当前日期选择应大于当天日期",
  224. format:"Y-m-d",
  225. columnWidth:0.5,
  226. id: 'fa_start_data',
  227. name:"start_data",
  228. editable:false,//只读约束
  229. anchor:'80%'
  230. },{
  231. xtype:'datefield',
  232. fieldLabel:"结束日期",
  233. minValue:data,
  234. // '07/07/2017',
  235. minText:"当前日期选择应大于当天日期",
  236. format:"Y-m-d",
  237. columnWidth:0.5,
  238. id: 'fa_end_data',
  239. name:"end_data",
  240. editable:false,//只读约束
  241. anchor:'80%'
  242. },{
  243. id: 'fa_completion_status',
  244. name:'completion_status',
  245. hidden:true
  246. },{
  247. id:'fa_queryJson',
  248. name:'queryJson',
  249. hidden:true
  250. }],
  251. buttons: [{
  252. text: '提交',
  253. iconCls:'ok_btn',
  254. handler: function() {
  255. var form = this.up('form').getForm();
  256. if (form.isValid()) {
  257. var InspectiontimeValue = Ext.getCmp('Inspectiontime').getChecked();
  258. var Inspectiontime='';
  259. Ext.Array.each(InspectiontimeValue, function(item){
  260. Inspectiontime +=item.inputValue+'|';
  261. });
  262. // var start_data = Ext.util.Format.date(Ext.getCmp('fa_start_data').getValue(), 'Y-m-d');
  263. // var end_data = Ext.util.Format.date(Ext.getCmp('fa_end_data').getValue(), 'Y-m-d');
  264. var V_LOGINNAME = $("#V_LOGINNAME").val();
  265. var V_PASSWORD = $("#V_PASSWORD").val();
  266. var start_time = Ext.getCmp('fa_start_time').getValue();
  267. var start_time1=((start_time.getHours()<10)?('0'+start_time.getHours()):start_time.getHours()) + ':' + ((start_time.getMinutes()<10)?('0'+start_time.getMinutes()):start_time.getMinutes());
  268. var end_time = Ext.getCmp('fa_end_time').getValue();
  269. var end_time1=((end_time.getHours()<10)?('0'+end_time.getHours()):end_time.getHours()) + ':' + ((end_time.getMinutes()<10)?('0'+end_time.getMinutes()):end_time.getMinutes());
  270. // Ext.MessageBox.alert('提示', '您的兴趣是' + V_LOGINNAME);
  271. var query = new Object();
  272. query.start_data = Ext.util.Format.date(Ext.getCmp('fa_start_data').getValue(), 'Y-m-d');
  273. query.end_data = Ext.util.Format.date(Ext.getCmp('fa_end_data').getValue(), 'Y-m-d');
  274. query.Inspectiontime = Inspectiontime;
  275. query.personnel = Ext.getCmp('fa_personnel').getValue();
  276. query.route = Ext.getCmp('fa_route').getValue();
  277. // query.planned_date = Ext.getCmp('fa_planned_date').getValue();
  278. query.V_LOGINNAME = V_LOGINNAME;
  279. query.V_PASSWORD = V_PASSWORD;
  280. query.start_time = start_time1;
  281. query.end_time = end_time1;
  282. query.completion_status = Ext.getCmp('fa_completion_status').getValue();
  283. var jsonstr = Ext.JSON.encode(query);
  284. Ext.getCmp('fa_queryJson').setValue(jsonstr);
  285. form.submit({
  286. method:'post',
  287. success: function(form, action) {
  288. Ext.Msg.alert('操作成功', '新增计划已保存', function(btn,txt){
  289. clear_append_form();
  290. });
  291. },
  292. failure: function(form, action) {
  293. Ext.Msg.alert('操作失败', action.Msg , function(btn,txt){
  294. clear_append_form();
  295. });
  296. }
  297. });
  298. }
  299. }
  300. },{
  301. text: '关闭',
  302. iconCls: 'cancel_btn',
  303. handler: function() {
  304. this.up('window').hide();
  305. }
  306. }]
  307. });
  308. var appendwin = function(){
  309. Ext.create('Ext.window.Window', {
  310. title: '新增',
  311. height: 350,
  312. width: 400,
  313. layout: 'fit',
  314. items: AppendForm,
  315. closeAction: 'hide'
  316. }).show();
  317. }
  318. //筛选
  319. var clear_filter_form = function(){
  320. Ext.getCmp('ff_personnel').setValue("");
  321. Ext.getCmp('ff_route').setValue("");
  322. Ext.getCmp('ff_planned_date').setValue("");
  323. Ext.getCmp('ff_start_time').setValue("");
  324. Ext.getCmp('ff_end_time').setValue("");
  325. Ext.getCmp('ff_completion_status').setValue("");
  326. }
  327. var FilterWin = Ext.create('Ext.form.Panel', {
  328. id: 'PatrolPlanFilterForm',
  329. labelWidth: 55,
  330. defaultType: 'textfield',
  331. bodyPadding: 15,
  332. items: [{
  333. fieldLabel:'巡检人',
  334. id: 'ff_personnel',
  335. name:'personnel',
  336. maxLength:20,
  337. maxLengthText:'长度不得超出{0}',
  338. value : document.getElementById('personnel').value,
  339. anchor:'75%'
  340. },{
  341. fieldLabel:'巡检路线',
  342. id:'ff_route',
  343. name:'route',
  344. maxLength: 250,
  345. maxLengthText:'长度不得超出{0}',
  346. value : document.getElementById('route').value,
  347. editable : false
  348. },{
  349. fieldLabel:'巡检日期',
  350. id: 'ff_planned_date',
  351. name: 'planned_date',
  352. maxLength: 250,
  353. maxLengthText:'长度不得超出{0}',
  354. value : document.getElementById('planned_date').value,
  355. anchor:'95%'
  356. },{
  357. fieldLabel:'开始时间',
  358. id: 'ff_start_time',
  359. name: 'start_time',
  360. maxLength: 250,
  361. maxLengthText:'长度不得超出{0}',
  362. value : document.getElementById('start_time').value,
  363. anchor:'95%'
  364. },{
  365. fieldLabel:'结束时间',
  366. id: 'ff_end_time',
  367. name: 'end_time',
  368. maxLength: 250,
  369. maxLengthText:'长度不得超出{0}',
  370. value : document.getElementById('end_time').value,
  371. anchor:'95%'
  372. },{
  373. fieldLabel:'完成情况(%)',
  374. id: 'ff_completion_status',
  375. name: 'completion_status',
  376. maxLength: 250,
  377. maxLengthText:'长度不得超出{0}',
  378. value : document.getElementById('completion_status').value,
  379. anchor:'95%'
  380. },{
  381. id:'ff_queryJson',
  382. name:'queryJson',
  383. hidden:true
  384. }],
  385. buttons: [{
  386. text: '提交',
  387. iconCls:'ok_btn',
  388. handler: function() {
  389. var form = this.up('form').getForm();
  390. if (form.isValid()) {
  391. var query = new Object();
  392. if(Ext.getCmp('ff_personnel').getValue().length>0)
  393. query.personnel = Ext.getCmp('ff_personnel').getValue();
  394. if(Ext.getCmp('ff_route').getValue().length>0)
  395. query.route = Ext.getCmp('ff_route').getValue();
  396. if(Ext.getCmp('ff_planned_date').getValue().length>0)
  397. query.planned_date = Ext.getCmp('ff_planned_date').getValue();
  398. if(Ext.getCmp('ff_start_time').getValue().length>0)
  399. query.start_time = Ext.getCmp('ff_start_time').getValue();
  400. if(Ext.getCmp('ff_end_time').getValue().length>0)
  401. query.end_time = Ext.getCmp('ff_end_time').getValue();
  402. if(Ext.getCmp('ff_completion_status').getValue().length>0)
  403. query.completion_status = Ext.getCmp('ff_completion_status').getValue();
  404. var jsonstr = Ext.JSON.encode(query);
  405. myStore.getProxy().extraParams = {
  406. queryJson : jsonstr
  407. };
  408. Ext.getCmp('PatrolPlanListPageToolbar').moveFirst();
  409. Ext.getCmp('personnel').setValue(query.personnel);
  410. Ext.getCmp('route').setValue(query.route);
  411. Ext.getCmp('planned_date').setValue(query.planned_date);
  412. Ext.getCmp('start_time').setValue(query.start_time);
  413. Ext.getCmp('end_time').setValue(query.end_time);
  414. Ext.getCmp('completion_status').setValue(query.completion_status);
  415. // myStore.reload();
  416. clear_filter_form();
  417. this.up('window').hide();
  418. }
  419. }
  420. },{
  421. text: '关闭',
  422. iconCls: 'cancel_btn',
  423. handler: function() {
  424. this.up('window').hide();
  425. }
  426. }]
  427. });
  428. var filterwin = function() {
  429. Ext.create('Ext.window.Window',{
  430. title: '筛选',
  431. height: 300,
  432. width: 350,
  433. layout: 'fit',
  434. items: FilterWin,
  435. closeAction: 'hide'
  436. }).show();
  437. }
  438. var clear_modify_form = function (){
  439. Ext.getCmp('fm_id').setValue("");
  440. Ext.getCmp('fm_route').setValue("");
  441. Ext.getCmp('fm_planned_date').setValue("");
  442. Ext.getCmp('fm_start_time').setValue("");
  443. Ext.getCmp('fm_end_time').setValue("");
  444. Ext.getCmp('fm_personnel').setValue("");
  445. Ext.getCmp('fm_completion_status').setValue("");
  446. Ext.getCmp('PatrolPlanListPanel').getStore().reload();
  447. }
  448. var ModifyForm = Ext.create('Ext.form.Panel', {
  449. id: 'PatrolPlanEditForm',
  450. labelWidth: 55,
  451. url: baseUrl+'iot/patrolplan/update',
  452. defaultType: 'textfield',
  453. bodyPadding: 15,
  454. items: [{
  455. fieldLabel:'巡检人',
  456. id: 'fm_personnel',
  457. name:'personnel',
  458. maxLength:20,
  459. maxLengthText:'长度不得超出{0}',
  460. anchor:'75%'
  461. },{
  462. fieldLabel:'巡检路线',
  463. id: 'fm_route',
  464. name: 'route',
  465. maxLength: 250,
  466. maxLengthText:'长度不得超出{0}',
  467. anchor:'95%'
  468. },{
  469. fieldLabel:'巡检日期',
  470. id: 'fm_planned_date',
  471. name: 'planned_date',
  472. maxLength: 250,
  473. maxLengthText:'长度不得超出{0}',
  474. anchor:'95%'
  475. },{
  476. fieldLabel:'开始时间',
  477. id: 'fm_start_time',
  478. name:'start_time',
  479. maxLength: 30,
  480. maxLengthText:'长度不得超出{0}',
  481. anchor:'95%'
  482. },{
  483. fieldLabel:'结束时间',
  484. id: 'fm_end_time',
  485. name:'end_time',
  486. maxLength: 30,
  487. maxLengthText:'长度不得超出{0}',
  488. anchor:'95%'
  489. },{
  490. id: 'fm_completion_status',
  491. name:'completion_status',
  492. hidden:true
  493. },{
  494. id: 'fm_id',
  495. name:'id',
  496. hidden:true
  497. },{
  498. id:'fm_queryJson',
  499. name:'queryJson',
  500. hidden:true
  501. }],
  502. buttons: [{
  503. text: '修改',
  504. iconCls:'ok_btn',
  505. handler: function() {
  506. var form = this.up('form').getForm();
  507. if (form.isValid()) {
  508. var query = new Object();
  509. query.id = Ext.getCmp('fm_id').getValue();
  510. query.completion_status = Ext.getCmp('fm_completion_status').getValue();
  511. query.personnel = Ext.getCmp('fm_personnel').getValue();
  512. query.route = Ext.getCmp('fm_route').getValue();
  513. query.planned_date = Ext.getCmp('fm_planned_date').getValue();
  514. query.start_time = Ext.getCmp('fm_start_time').getValue();
  515. query.end_time = Ext.getCmp('fm_end_time').getValue();
  516. var jsonstr = Ext.JSON.encode(query);
  517. Ext.getCmp('fm_queryJson').setValue(jsonstr);
  518. form.submit({
  519. method:'post',
  520. success: function(form, action) {
  521. Ext.Msg.alert('操作成功', '已修改', function(btn,txt){
  522. clear_modify_form();
  523. });
  524. },
  525. failure: function(form, action) {
  526. Ext.Msg.alert('操作失败', action.Msg , function(btn,txt){
  527. clear_modify_form();
  528. });
  529. }
  530. });
  531. this.up('window').hide();
  532. }
  533. }
  534. },{
  535. text: '关闭',
  536. iconCls: 'cancel_btn',
  537. handler: function() {
  538. this.up('window').hide();
  539. }
  540. }]
  541. });
  542. var modifywin = function(){
  543. Ext.create('Ext.window.Window', {
  544. title: '修改',
  545. height: 350,
  546. width: 400,
  547. layout: 'fit',
  548. items: ModifyForm,
  549. closeAction: 'hide'
  550. }).show();
  551. }
  552. var chk_sm = function() {
  553. if(sm.getCount()==1){
  554. modifywin();
  555. var selected = sm.getSelection( );
  556. Ext.getCmp('fm_id').setValue(selected[0].raw.id);
  557. Ext.getCmp('fm_personnel').setValue(selected[0].raw.personnel);
  558. Ext.getCmp('fm_route').setValue(selected[0].raw.route);
  559. Ext.getCmp('fm_planned_date').setValue(selected[0].raw.planned_date);
  560. Ext.getCmp('fm_start_time').setValue(selected[0].raw.start_time);
  561. Ext.getCmp('fm_end_time').setValue(selected[0].raw.end_time);
  562. Ext.getCmp('fm_completion_status').setValue(selected[0].raw.completion_status);
  563. }else{
  564. Ext.Msg.alert('请先选择','请先选择一条记录,再点击修改');
  565. }
  566. }
  567. //
  568. // var deletewin = function() {
  569. // window.alert("无此功能");
  570. //
  571. // }
  572. Ext.create('Ext.grid.Panel', {
  573. title: '巡检计划管理',
  574. id: 'PatrolPlanListPanel',
  575. store: myStore,
  576. selModel: sm,
  577. columns: [
  578. //{ header: 'ID', dataIndex: 'UQ_POINT_ID',hidden:true, menuDisabled:true },
  579. { header: 'ID', dataIndex: 'id', width:40, menuDisabled:true },
  580. { header: '巡检人', dataIndex: 'personnel', width:120,align:'center', menuDisabled:true },
  581. { header: '巡检路线', dataIndex: 'route', width:160,align:'center', menuDisabled:true },
  582. { header: '巡检日期', dataIndex: 'planned_date', width:120,align:'center', menuDisabled:true },
  583. { header: '开始时间', dataIndex: 'start_time',width:160, align:'center', menuDisabled:true },
  584. { header: '结束时间', dataIndex: 'end_time', width:120, align:'center', menuDisabled:true },
  585. { header: '完成情况(%)', dataIndex: 'completion_status', width:120, align:'center', menuDisabled:true },
  586. // {
  587. // xtype : 'actioncolumn',
  588. // width:20,
  589. // sortable:false,
  590. //
  591. //
  592. // //这里
  593. // align:'center',
  594. // menuDisabled:true,
  595. // items:[{
  596. // icon: '../../res/img/common/forum.gif',
  597. // tooltip: '版本记录',
  598. // handler: function(grid, rowIndex, colIndex) {
  599. // var rec = grid.getStore().getAt(rowIndex);
  600. // window.location = 'version.jsp?theme='+theme+'&pointId='+rec.get('UQ_POINT_ID');
  601. // }
  602. // }]
  603. // }
  604. ],
  605. columnLines: true,
  606. tbar: [
  607. {
  608. xtype: 'button',
  609. iconCls:'filter_btn',
  610. text: '筛选',
  611. listeners: {
  612. click: filterwin
  613. }
  614. },'-',
  615. {xtype: 'tbfill'},'-',
  616. {
  617. xtype: 'button',
  618. iconCls:'append_btn',
  619. text: '新增',
  620. listeners: {
  621. click: appendwin
  622. }
  623. },
  624. {
  625. xtype: 'button',
  626. iconCls:'modify_btn',
  627. text: '修改',
  628. listeners: {
  629. click: chk_sm
  630. }
  631. },
  632. // {
  633. // xtype: 'button',
  634. // iconCls:'delete_btn',
  635. // text: '注销',
  636. // listeners: {
  637. // click: deletewin
  638. // }
  639. // }
  640. // ,{
  641. // xtype: 'button',
  642. // iconCls:'delete_btn',
  643. // text: '导出',
  644. // listeners: {
  645. // click: export_sj
  646. // }
  647. // }
  648. ],
  649. height: maxHeight,
  650. width: '100%',
  651. bbar: new Ext.PagingToolbar({
  652. store: myStore,
  653. id:'PatrolPlanListPageToolbar',
  654. displayInfo: true,
  655. pageSize: countPerPage,
  656. prependButtons: true,
  657. displayMsg : '显示第 {0}条到 {1}条记录,总共 {2}条',
  658. emptyMsg : "没有记录",
  659. firstText: '第一页',
  660. prevText: '前一页',
  661. nextText: '后一页',
  662. lastText: '最后一页',
  663. refreshText: '刷新',
  664. // doRefresh:function(start){
  665. // alert(start);
  666. // relushDataFunction(start); // 调用函数刷新数据
  667. // this.cursor = start; // 更新页签
  668. // }
  669. }),
  670. frame: true,
  671. border:false,
  672. iconCls: 'icon-grid',
  673. renderTo: Ext.getBody()
  674. });
  675. myStore.reload();
  676. maxHeight = document.documentElement.clientHeight;
  677. Ext.getCmp('PatrolPlanListPanel').setHeight(maxHeight);
  678. });