outcrypackage.js 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863
  1. /**
  2. * OutcryPackage.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('OutcryPackage',{
  19. extend: 'Ext.data.Model',
  20. fields: [
  21. {name:'UQ_SETMREAL_ZB_ID', type:'string'},
  22. {name:'UQ_SETMREAL_ID', type:'string'},
  23. {name:'I_ORDER_IDX', type:'int'},
  24. {name:'UQ_CATEGORY', type:'string'},
  25. {name:'UQ_CATEGORY1', type:'string'},
  26. {name:'I_NUMBER_OF_BARS', type:'string'},
  27. {name:'V_COMPANY_NAME', type:'string'},
  28. {name:'I_CYCLE', type:'string'},
  29. {name:'I_CYCLE1', type:'string'},
  30. {name:'UQ_COMPANY_ID', type:'string'},
  31. {name:'D_START_STORETIME', type:'string'},
  32. {name:'D_END_STORETIME', type:'string'},
  33. {name:'V_PHONE', type:'string'},
  34. {name:'E_STATUS', type:'string'},
  35. ]
  36. });
  37. Ext.define('CompanyComboStore',{
  38. extend:'Ext.data.Model',
  39. fields: [
  40. {name:'owner_name', type:'string'},
  41. {name:'owner_id',type:'string'}
  42. ]
  43. });
  44. Ext.onReady(function(){
  45. var baseUrl = document.getElementById('basePath').value;
  46. var theme = document.getElementById('theme').value;
  47. var chkIcon = '<img src="'+baseUrl+'res/img/common/check.gif"/>'
  48. var unchkIcon = '<img src="'+baseUrl+'res/img/common/uncheck.gif"/>'
  49. var countPerPage = 20;
  50. var maxHeight = 10000;
  51. var chkBoolean = function(flag) {
  52. if(flag)
  53. return chkIcon;
  54. return unchkIcon;
  55. }
  56. var states = Ext.create('Ext.data.Store', {
  57. fields: ['status', 'name'],
  58. data : [
  59. {"status":1, "name":"火系统报警"},
  60. {"status":2, "name":"水系统报警"},
  61. {"status":3, "name":"烟感报警"},
  62. {"status":4, "name":"消防栓报警"},
  63. {"status":5, "name":"液位报警"},
  64. {"status":6, "name":"RTU报警"},
  65. {"status":7, "name":"电气火灾报警"},
  66. {"status":8, "name":"离线报警"},
  67. ]
  68. });
  69. var states1 = Ext.create('Ext.data.Store', {
  70. fields: ['status', 'name'],
  71. data : [
  72. {"status":0, "name":"天"},
  73. {"status":1, "name":"月"},
  74. {"status":2, "name":"年"},
  75. ]
  76. });
  77. var clear_append_form = function (){
  78. Ext.getCmp('fa_UQ_COMPANY_ID').setValue("");
  79. Ext.getCmp('fa_UQ_CATEGORY').setValue("");
  80. Ext.getCmp('fa_I_NUMBER_OF_BARS').setValue("");
  81. Ext.getCmp('fa_I_CYCLE').setValue("");
  82. Ext.getCmp('fa_D_START_STORETIME').setValue("");
  83. Ext.getCmp('fa_D_END_STORETIME').setValue("");
  84. Ext.getCmp('fa_V_PHONE').setValue("");
  85. Ext.getCmp('OutcryPackageListPanel').getStore().reload();
  86. }
  87. var myStore = Ext.create('Ext.data.Store', {
  88. model: 'OutcryPackage',
  89. pageSize: countPerPage,
  90. proxy: {
  91. type: 'ajax',
  92. url: baseUrl+'iot/outcrypackage/getList',
  93. reader: {
  94. type: 'json',
  95. root: 'RESULT',
  96. totalProperty: 'totalCount'
  97. }
  98. },
  99. remoteSort: true
  100. });
  101. var CompanyStory = Ext.create('Ext.data.Store', {
  102. model: 'CompanyComboStore',
  103. pageSize: countPerPage,
  104. proxy: {
  105. type: 'ajax',
  106. url: baseUrl+'iot/company/view/getNameList',
  107. reader: {
  108. type: 'json',
  109. root: 'RESULT',
  110. totalProperty: 'totalCount'
  111. }
  112. },
  113. remoteSort: true
  114. });
  115. var data =Ext.Date.format(new Date(), 'm/d/Y');
  116. var AppendForm = Ext.create('Ext.form.Panel', {
  117. id: 'OutcryPackageAppendForm',
  118. labelWidth: 55,
  119. url: baseUrl+'iot/outcrypackage/append',
  120. defaultType: 'textfield',
  121. bodyPadding: 15,
  122. items: [{
  123. xtype:'combo',
  124. fieldLabel:'单位名称',
  125. id: 'fa_UQ_COMPANY_ID',
  126. name:'UQ_COMPANY_ID',
  127. displayField : 'owner_name',
  128. valueField : 'owner_id',
  129. editable : false,
  130. width:330,
  131. store:CompanyStory
  132. },{
  133. fieldLabel:'类别',
  134. id:'fa_UQ_CATEGORY',
  135. name:'UQ_CATEGORY',
  136. xtype:'combo',
  137. store:states,
  138. displayField : 'name',
  139. valueField : 'status',
  140. width:330,
  141. editable : false
  142. },{
  143. fieldLabel:'规格',
  144. id:'fa_I_CYCLE',
  145. name:'I_CYCLE',
  146. xtype:'combo',
  147. store:states1,
  148. displayField : 'name',
  149. valueField : 'status',
  150. width:330,
  151. editable : false
  152. },{
  153. fieldLabel:'数量',
  154. id: 'fa_I_NUMBER_OF_BARS',
  155. name: 'I_NUMBER_OF_BARS',
  156. maxLength: 300,
  157. maxLengthText:'长度不得超出{0}',
  158. anchor:'90%'
  159. },{
  160. fieldLabel:'手机号 ',
  161. id: 'fa_V_PHONE',
  162. name: 'V_PHONE',
  163. maxLength: 11,
  164. maxLengthText:'长度不得超出{0}',
  165. anchor:'90%'
  166. },{
  167. xtype:'datefield',
  168. fieldLabel:"开始日期",
  169. minValue:data,
  170. // '07/07/2017',
  171. minText:"当前日期选择应大于当天日期",
  172. format:"Y-m-d",
  173. columnWidth:0.5,
  174. id: 'fa_D_START_STORETIME',
  175. name:"D_END_STORETIME",
  176. editable:false,//只读约束
  177. anchor:'80%'
  178. // fieldLabel:'开始日期',
  179. // id: 'fa_D_START_STORETIME',
  180. // name: 'D_START_STORETIME',
  181. // maxLength: 250,
  182. // maxLengthText:'长度不得超出{0}',
  183. // anchor:'95%'
  184. },{
  185. xtype:'datefield',
  186. fieldLabel:"结束日期",
  187. minValue:data,
  188. // '07/07/2017',
  189. minText:"当前日期选择应大于当天日期",
  190. format:"Y-m-d",
  191. columnWidth:0.5,
  192. id: 'fa_D_END_STORETIME',
  193. name:"D_END_STORETIME",
  194. editable:false,//只读约束
  195. anchor:'80%'
  196. // fieldLabel:'结束日期',
  197. // id: 'fa_D_END_STORETIME',
  198. // name:'D_END_STORETIME',
  199. // maxLength: 30,
  200. // maxLengthText:'长度不得超出{0}',
  201. // anchor:'95%'
  202. },{
  203. id:'fa_queryJson',
  204. name:'queryJson',
  205. hidden:true
  206. }],
  207. buttons: [{
  208. text: '提交',
  209. iconCls:'ok_btn',
  210. handler: function() {
  211. var form = this.up('form').getForm();
  212. if (form.isValid()) {
  213. var query = new Object();
  214. query.UQ_COMPANY_ID = Ext.getCmp('fa_UQ_COMPANY_ID').getValue();
  215. query.UQ_CATEGORY = Ext.getCmp('fa_UQ_CATEGORY').getValue();
  216. query.I_NUMBER_OF_BARS = Ext.getCmp('fa_I_NUMBER_OF_BARS').getValue();
  217. query.I_CYCLE = Ext.getCmp('fa_I_CYCLE').getValue();
  218. query.D_START_STORETIME = Ext.getCmp('fa_D_START_STORETIME').getValue();
  219. query.D_END_STORETIME = Ext.getCmp('fa_D_END_STORETIME').getValue();
  220. query.V_PHONE = Ext.getCmp('fa_V_PHONE').getValue();
  221. var jsonstr = Ext.JSON.encode(query);
  222. Ext.getCmp('fa_queryJson').setValue(jsonstr);
  223. form.submit({
  224. method:'post',
  225. success: function(form, action) {
  226. Ext.Msg.alert('操作成功', '已保存', function(btn,txt){
  227. clear_append_form();
  228. });
  229. },
  230. failure: function(form, action) {
  231. Ext.Msg.alert('操作失败', action.Msg , function(btn,txt){
  232. clear_append_form();
  233. });
  234. }
  235. });
  236. }
  237. }
  238. },{
  239. text: '关闭',
  240. iconCls: 'cancel_btn',
  241. handler: function() {
  242. this.up('window').hide();
  243. }
  244. }]
  245. });
  246. var appendwin = function(){
  247. Ext.create('Ext.window.Window', {
  248. title: '新增',
  249. height: 450,
  250. width: 400,
  251. layout: 'fit',
  252. items: AppendForm,
  253. closeAction: 'hide'
  254. }).show();
  255. }
  256. //筛选
  257. var clear_filter_form = function(){
  258. Ext.getCmp('ff_UQ_COMPANY_ID').setValue("");
  259. Ext.getCmp('ff_D_START_STORETIME').setValue("");
  260. Ext.getCmp('ff_D_END_STORETIME').setValue("");
  261. Ext.getCmp('ff_UQ_CATEGORY').setValue("");
  262. Ext.getCmp('ff_I_NUMBER_OF_BARS').setValue("");
  263. Ext.getCmp('ff_I_CYCLE').setValue("");
  264. }
  265. var FilterWin = Ext.create('Ext.form.Panel', {
  266. id: 'OutcryPackageFilterForm',
  267. labelWidth: 55,
  268. defaultType: 'textfield',
  269. bodyPadding: 15,
  270. items: [{
  271. // xtype:'combo',
  272. // fieldLabel:'单位名称',
  273. // id: 'ff_UQ_COMPANY_ID',
  274. // name:'UQ_COMPANY_ID',
  275. // displayField : 'owner_name',
  276. // valueField : 'owner_id',
  277. // value : document.getElementById('companyId').value,
  278. // editable : false,
  279. // width:330,
  280. // store:CompanyStory
  281. fieldLabel:'单位编号',
  282. id: 'ff_UQ_COMPANY_ID',
  283. name:'UQ_COMPANY_ID',
  284. maxLength:20,
  285. maxLengthText:'长度不得超出{0}',
  286. value : document.getElementById('companyId').value,
  287. anchor:'95%'
  288. },{
  289. // fieldLabel:'类别',
  290. // id:'ff_UQ_CATEGORY',
  291. // name:'UQ_CATEGORY',
  292. // xtype:'combo',
  293. // store:states,
  294. // displayField : 'name',
  295. // valueField : 'status',
  296. //// value : -1,
  297. // width:330,
  298. // editable : false
  299. fieldLabel:'类别',
  300. id: 'ff_UQ_CATEGORY',
  301. name:'UQ_CATEGORY',
  302. maxLength: 30,
  303. maxLengthText:'长度不得超出{0}',
  304. value : document.getElementById('uqCategory').value,
  305. anchor:'95%'
  306. },{
  307. // fieldLabel:'规格',
  308. // id:'ff_I_CYCLE',
  309. // name:'I_CYCLE',
  310. // xtype:'combo',
  311. // store:states1,
  312. // displayField : 'name',
  313. // valueField : 'status',
  314. // width:330,
  315. // editable : false
  316. fieldLabel:'规格',
  317. id: 'ff_I_CYCLE',
  318. name:'I_CYCLE',
  319. maxLength: 30,
  320. maxLengthText:'长度不得超出{0}',
  321. value : document.getElementById('iCycle').value,
  322. anchor:'95%'
  323. },{
  324. fieldLabel:'数量',
  325. id: 'ff_I_NUMBER_OF_BARS',
  326. name:'I_NUMBER_OF_BARS',
  327. maxLength: 30,
  328. maxLengthText:'长度不得超出{0}',
  329. value : document.getElementById('iNumberOfBars').value,
  330. anchor:'95%'
  331. },{
  332. fieldLabel:'手机号 ',
  333. id: 'ff_V_PHONE',
  334. name: 'V_PHONE',
  335. maxLength: 11,
  336. maxLengthText:'长度不得超出{0}',
  337. value : document.getElementById('vPhone').value,
  338. anchor:'95%'
  339. },{
  340. fieldLabel:'开始日期',
  341. id: 'ff_D_START_STORETIME',
  342. name: 'D_START_STORETIME',
  343. maxLength: 250,
  344. maxLengthText:'长度不得超出{0}',
  345. value : document.getElementById('dStartStoretime').value,
  346. anchor:'95%'
  347. },{
  348. fieldLabel:'结束日期',
  349. id: 'ff_D_END_STORETIME',
  350. name:'D_END_STORETIME',
  351. maxLength: 30,
  352. maxLengthText:'长度不得超出{0}',
  353. value : document.getElementById('dEndStoretime').value,
  354. anchor:'95%'
  355. },{
  356. id:'ff_queryJson',
  357. name:'queryJson',
  358. hidden:true
  359. }],
  360. buttons: [{
  361. text: '提交',
  362. iconCls:'ok_btn',
  363. handler: function() {
  364. var form = this.up('form').getForm();
  365. if (form.isValid()) {
  366. var query = new Object();
  367. if(Ext.getCmp('ff_UQ_COMPANY_ID').getValue().length>0)
  368. query.UQ_COMPANY_ID = Ext.getCmp('ff_UQ_COMPANY_ID').getValue();
  369. if(Ext.getCmp('ff_V_PHONE').getValue().length>0)
  370. query.V_PHONE = Ext.getCmp('ff_V_PHONE').getValue();
  371. if(Ext.getCmp('ff_D_START_STORETIME').getValue().length>0)
  372. query.D_START_STORETIME = Ext.getCmp('ff_D_START_STORETIME').getValue();
  373. if(Ext.getCmp('ff_D_END_STORETIME').getValue().length>0)
  374. query.D_END_STORETIME = Ext.getCmp('ff_D_END_STORETIME').getValue();
  375. if(Ext.getCmp('ff_UQ_CATEGORY').getValue().length>0){
  376. var a = Ext.getCmp('ff_UQ_CATEGORY').getValue();
  377. if(a=="火系统报警") {
  378. query.UQ_CATEGORY = 1;
  379. }else if(a=="水系统报警") {
  380. query.UQ_CATEGORY = 2;
  381. }else if(a=="烟感报警") {
  382. query.UQ_CATEGORY = 3;
  383. }else if(a=="消防栓报警") {
  384. query.UQ_CATEGORY = 4;
  385. }else if(a=="液位报警") {
  386. query.UQ_CATEGORY = 5;
  387. }else if(a=="RTU报警") {
  388. query.UQ_CATEGORY = 6;
  389. }else if(a=="电气火灾报警") {
  390. query.UQ_CATEGORY = 7;
  391. }else if(a=="离线报警") {
  392. query.UQ_CATEGORY = 8;
  393. }else{
  394. query.UQ_CATEGORY = Ext.getCmp('ff_UQ_CATEGORY').getValue();
  395. }
  396. }
  397. if(Ext.getCmp('ff_I_NUMBER_OF_BARS').getValue().length>0)
  398. query.I_NUMBER_OF_BARS = Ext.getCmp('ff_I_NUMBER_OF_BARS').getValue();
  399. if(Ext.getCmp('ff_I_CYCLE').getValue().length>0){
  400. var b = Ext.getCmp('ff_I_CYCLE').getValue();
  401. if(b=="天") {
  402. query.I_CYCLE =0;
  403. }else if(b=="月") {
  404. query.I_CYCLE =1;
  405. }else if(b=="年") {
  406. query.I_CYCLE =2;
  407. }else{
  408. query.I_CYCLE = Ext.getCmp('ff_I_CYCLE').getValue();
  409. }
  410. }
  411. var jsonstr = Ext.JSON.encode(query);
  412. myStore.getProxy().extraParams = {
  413. queryJson : jsonstr
  414. };
  415. Ext.getCmp('OutcryPackageListPageToolbar').moveFirst();
  416. Ext.getCmp('companyId').setValue(query.UQ_COMPANY_ID);
  417. Ext.getCmp('dStartStoretime').setValue(query.D_START_STORETIME);
  418. Ext.getCmp('uqCategory').setValue(query.UQ_CATEGORY);
  419. Ext.getCmp('dEndStoretime').setValue(query.D_END_STORETIME);
  420. Ext.getCmp('iNumberOfBars').setValue(query.I_NUMBER_OF_BARS);
  421. Ext.getCmp('iCycle').setValue(query.I_CYCLE);
  422. Ext.getCmp('vPhone').setValue(query.V_PHONE);
  423. // myStore.reload();
  424. clear_filter_form();
  425. this.up('window').hide();
  426. }
  427. }
  428. },{
  429. text: '关闭',
  430. iconCls: 'cancel_btn',
  431. handler: function() {
  432. this.up('window').hide();
  433. }
  434. }]
  435. });
  436. var filterwin = function() {
  437. Ext.create('Ext.window.Window',{
  438. title: '筛选',
  439. height: 320,
  440. width: 380,
  441. layout: 'fit',
  442. items: FilterWin,
  443. closeAction: 'hide'
  444. }).show();
  445. }
  446. var states4 = Ext.create('Ext.data.Store', {
  447. fields: ['status', 'name'],
  448. data : [
  449. // {"status":-1, "name":"全选"},
  450. {"status":"待开通", "name":"待开通"},
  451. {"status":"已开通", "name":"已开通"},
  452. {"status":"已锁定", "name":"已锁定"},
  453. {"status":"注销", "name":"注销"},
  454. ]
  455. });
  456. var clear_modify_form = function (){
  457. Ext.getCmp('fm_UQ_COMPANY_ID').setValue("");
  458. Ext.getCmp('fm_E_STATUS').setValue("");
  459. Ext.getCmp('fm_D_START_STORETIME').setValue("");
  460. Ext.getCmp('fm_D_END_STORETIME').setValue("");
  461. Ext.getCmp('fm_UQ_CATEGORY').setValue("");
  462. Ext.getCmp('fm_I_NUMBER_OF_BARS').setValue("");
  463. Ext.getCmp('fm_I_CYCLE').setValue("");
  464. Ext.getCmp('fm_UQ_SETMREAL_ZB_ID').setValue("");
  465. Ext.getCmp('fm_UQ_SETMREAL_ID').setValue("");
  466. Ext.getCmp('fm_V_PHONE').setValue("");
  467. Ext.getCmp('OutcryPackageListPanel').getStore().reload();
  468. }
  469. var ModifyForm = Ext.create('Ext.form.Panel', {
  470. id: 'OutcryPackageEditForm',
  471. labelWidth: 55,
  472. url: baseUrl+'iot/outcrypackage/update',
  473. defaultType: 'textfield',
  474. bodyPadding: 15,
  475. items: [{
  476. xtype:'combo',
  477. fieldLabel:'单位名称',
  478. id: 'fm_UQ_COMPANY_ID',
  479. name:'UQ_COMPANY_ID',
  480. displayField : 'owner_name',
  481. valueField : 'owner_name',
  482. editable : false,
  483. width:330,
  484. store:CompanyStory
  485. },{
  486. fieldLabel:'类别',
  487. id:'fm_UQ_CATEGORY',
  488. name:'UQ_CATEGORY',
  489. xtype:'combo',
  490. store:states,
  491. displayField : 'name',
  492. valueField : 'status',
  493. // value : -1,
  494. width:330,
  495. editable : false
  496. },{
  497. fieldLabel:'规格',
  498. id:'fm_I_CYCLE',
  499. name:'I_CYCLE',
  500. xtype:'combo',
  501. store:states1,
  502. displayField : 'name',
  503. valueField : 'status',
  504. width:330,
  505. editable : false,
  506. },{
  507. fieldLabel:'数量',
  508. id: 'fm_I_NUMBER_OF_BARS',
  509. name: 'I_NUMBER_OF_BARS',
  510. maxLength: 250,
  511. maxLengthText:'长度不得超出{0}',
  512. anchor:'90%'
  513. },{
  514. fieldLabel:'当前状态',
  515. id:'fm_E_STATUS',
  516. name:'E_STATUS',
  517. xtype:'combo',
  518. store:states4,
  519. displayField : 'name',
  520. valueField : 'status',
  521. value : -1,
  522. editable : false
  523. },{
  524. fieldLabel:'手机号 ',
  525. id: 'fm_V_PHONE',
  526. name: 'V_PHONE',
  527. maxLength: 11,
  528. maxLengthText:'长度不得超出{0}',
  529. anchor:'90%'
  530. },{
  531. fieldLabel:'开始日期',
  532. id: 'fm_D_START_STORETIME',
  533. name: 'D_START_STORETIME',
  534. maxLength: 250,
  535. maxLengthText:'长度不得超出{0}',
  536. anchor:'90%'
  537. },{
  538. fieldLabel:'结束日期',
  539. id: 'fm_D_END_STORETIME',
  540. name: 'D_END_STORETIME',
  541. maxLength: 250,
  542. maxLengthText:'长度不得超出{0}',
  543. anchor:'90%'
  544. },{
  545. id: 'fm_UQ_SETMREAL_ZB_ID',
  546. name:'UQ_SETMREAL_ZB_ID',
  547. hidden:true
  548. },{
  549. id: 'fm_UQ_SETMREAL_ID',
  550. name:'UQ_SETMREAL_ID',
  551. hidden:true
  552. },{
  553. id:'fm_queryJson',
  554. name:'queryJson',
  555. hidden:true
  556. }],
  557. buttons: [{
  558. text: '修改',
  559. iconCls:'ok_btn',
  560. handler: function() {
  561. var form = this.up('form').getForm();
  562. if (form.isValid()) {
  563. var query = new Object();
  564. var a = Ext.getCmp('fm_UQ_CATEGORY').getValue();
  565. if(a=="火系统报警") {
  566. query.UQ_CATEGORY = 1;
  567. }else if(a=="水系统报警") {
  568. query.UQ_CATEGORY = 2;
  569. }else if(a=="烟感报警") {
  570. query.UQ_CATEGORY = 3;
  571. }else if(a=="消防栓报警") {
  572. query.UQ_CATEGORY = 4;
  573. }else if(a=="液位报警") {
  574. query.UQ_CATEGORY = 5;
  575. }else if(a=="RTU报警") {
  576. query.UQ_CATEGORY = 6;
  577. }else if(a=="电气火灾报警") {
  578. query.UQ_CATEGORY = 7;
  579. }else if(a=="离线报警") {
  580. query.UQ_CATEGORY = 8;
  581. }else{
  582. query.UQ_CATEGORY = Ext.getCmp('fm_UQ_CATEGORY').getValue();
  583. }
  584. var b = Ext.getCmp('fm_I_CYCLE').getValue();
  585. if(b=="天") {
  586. query.I_CYCLE =0;
  587. }else if(b=="月") {
  588. query.I_CYCLE =1;
  589. }else if(b=="年") {
  590. query.I_CYCLE =2;
  591. }else{
  592. query.I_CYCLE = Ext.getCmp('fm_I_CYCLE').getValue();
  593. }
  594. if(Ext.getCmp('fm_E_STATUS').getValue()=="待开通"){
  595. query.E_STATUS=0;
  596. }
  597. if(Ext.getCmp('fm_E_STATUS').getValue()=="已开通"){
  598. query.E_STATUS=1;
  599. }
  600. if(Ext.getCmp('fm_E_STATUS').getValue()=="已锁定"){
  601. query.E_STATUS=2;
  602. }
  603. if(Ext.getCmp('fm_E_STATUS').getValue()=="注销"){
  604. query.E_STATUS=3;
  605. }
  606. query.UQ_COMPANY_ID = Ext.getCmp('fm_UQ_COMPANY_ID').getValue();
  607. query.V_PHONE = Ext.getCmp('fm_V_PHONE').getValue();
  608. query.D_START_STORETIME = Ext.getCmp('fm_D_START_STORETIME').getValue();
  609. query.UQ_SETMREAL_ZB_ID = Ext.getCmp('fm_UQ_SETMREAL_ZB_ID').getValue();
  610. query.UQ_SETMREAL_ID = Ext.getCmp('fm_UQ_SETMREAL_ID').getValue();
  611. // query.I_CYCLE = Ext.getCmp('fm_I_CYCLE').getValue();
  612. query.I_NUMBER_OF_BARS = Ext.getCmp('fm_I_NUMBER_OF_BARS').getValue();
  613. query.D_END_STORETIME = Ext.getCmp('fm_D_END_STORETIME').getValue();
  614. var jsonstr = Ext.JSON.encode(query);
  615. Ext.getCmp('fm_queryJson').setValue(jsonstr);
  616. form.submit({
  617. method:'post',
  618. success: function(form, action) {
  619. Ext.Msg.alert('操作成功', '已修改', function(btn,txt){
  620. clear_modify_form();
  621. });
  622. },
  623. failure: function(form, action) {
  624. Ext.Msg.alert('操作失败', action.Msg , function(btn,txt){
  625. clear_modify_form();
  626. });
  627. }
  628. });
  629. this.up('window').hide();
  630. }
  631. }
  632. },{
  633. text: '关闭',
  634. iconCls: 'cancel_btn',
  635. handler: function() {
  636. this.up('window').hide();
  637. }
  638. }]
  639. });
  640. var modifywin = function(){
  641. Ext.create('Ext.window.Window', {
  642. title: '修改',
  643. height: 350,
  644. width: 400,
  645. layout: 'fit',
  646. items: ModifyForm,
  647. closeAction: 'hide'
  648. }).show();
  649. }
  650. var chk_sm = function() {
  651. if(sm.getCount()==1){
  652. modifywin();
  653. var selected = sm.getSelection( );
  654. // var estatus = parseInt(selected[0].raw.E_STATUS);
  655. Ext.getCmp('fm_UQ_COMPANY_ID').setValue(selected[0].raw.V_COMPANY_NAME);
  656. Ext.getCmp('fm_V_PHONE').setValue(selected[0].raw.V_PHONE);
  657. Ext.getCmp('fm_D_START_STORETIME').setValue(selected[0].raw.D_START_STORETIME);
  658. Ext.getCmp('fm_D_END_STORETIME').setValue(selected[0].raw.D_END_STORETIME);
  659. Ext.getCmp('fm_UQ_CATEGORY').setValue(selected[0].raw.UQ_CATEGORY);
  660. Ext.getCmp('fm_I_NUMBER_OF_BARS').setValue(selected[0].raw.I_NUMBER_OF_BARS);
  661. Ext.getCmp('fm_I_CYCLE').setValue(selected[0].raw.I_CYCLE);
  662. Ext.getCmp('fm_UQ_SETMREAL_ID').setValue(selected[0].raw.UQ_SETMREAL_ID);
  663. Ext.getCmp('fm_UQ_SETMREAL_ZB_ID').setValue(selected[0].raw.UQ_SETMREAL_ZB_ID);
  664. Ext.getCmp('fm_E_STATUS').setValue(selected[0].raw.E_STATUS);
  665. }else{
  666. Ext.Msg.alert('请先选择','请先选择一条记录,再点击修改');
  667. }
  668. }
  669. var clear_filter_form1 = function(){
  670. // Ext.getCmp('fc_UQ_SETMREAL_ID').setValue("");
  671. Ext.getCmp('fc_UQ_SETMREAL_ZB_ID').setValue("");
  672. // Ext.getCmp('fc_E_STATUS').setValue(-1);
  673. // Ext.getCmp('PermissionListPanel').getStore().reload();
  674. }
  675. var deletewin = function() {
  676. if(sm.getCount()>=1){
  677. // var companyname = selected[0].raw.V_COMPANY_NAME;
  678. // window.alert(selected[0].raw);
  679. var query = new Object();
  680. var list = new Array();
  681. for (var i=0;i<sm.getCount();i++)
  682. {
  683. var selected = sm.getSelection( );
  684. var o = new Object();
  685. o.UQ_SETMREAL_ZB_ID = selected[i].raw.UQ_SETMREAL_ZB_ID;
  686. list.push(o);
  687. }
  688. query.UQ_SETMREAL_ZB_ID_LIST = list;
  689. var jsonstr= Ext.JSON.encode(query);
  690. Ext.MessageBox.confirm('注销','是否注销'+sm.getCount()+'个?',function(btn){
  691. if(btn=='yes'){
  692. Ext.Ajax.request( {
  693. timeout : 3000000,
  694. url: baseUrl+'iot/outcrypackage/del',
  695. params : 'queryJson='+ jsonstr,
  696. success: function(resp,opts){
  697. myStore.reload();
  698. }
  699. });
  700. }
  701. },this);
  702. }else{
  703. Ext.Msg.alert('请先选择','请先选择一条记录,再点击删除');
  704. }
  705. }
  706. Ext.create('Ext.grid.Panel', {
  707. title: '语音报警套餐管理',
  708. id: 'OutcryPackageListPanel',
  709. store: myStore,
  710. selModel: sm,
  711. columns: [
  712. { header: 'ID', dataIndex: 'UQ_SETMREAL_ZB_ID',hidden:true, menuDisabled:true },
  713. { header: 'ID', dataIndex: 'UQ_SETMREAL_ID',hidden:true, menuDisabled:true },
  714. { header: 'ID', dataIndex: 'UQ_COMPANY_ID',hidden:true, menuDisabled:true },
  715. { header: '序号', dataIndex: 'I_ORDER_IDX', width:40, menuDisabled:true },
  716. { header: '单位名称', dataIndex: 'V_COMPANY_NAME', width:240, menuDisabled:true },
  717. { header: '类别', dataIndex: 'UQ_CATEGORY', width:120, menuDisabled:true },
  718. { header: '数量', dataIndex: 'I_NUMBER_OF_BARS', width:90, menuDisabled:true },
  719. { header: '规格', dataIndex: 'I_CYCLE', width:90, menuDisabled:true },
  720. { header: '当前状态', dataIndex: 'E_STATUS',width:120, align:'center', menuDisabled:true },
  721. { header: '外呼手机号', dataIndex: 'V_PHONE', width:120, menuDisabled:true },
  722. { header: '开始日期', dataIndex: 'D_START_STORETIME',width:240, align:'center', menuDisabled:true },
  723. { header: '结束日期', dataIndex: 'D_END_STORETIME', width:240, align:'center', menuDisabled:true },
  724. // {
  725. // xtype : 'actioncolumn',
  726. // width:20,
  727. // sortable:false,
  728. //
  729. //
  730. // //这里
  731. // align:'center',
  732. // menuDisabled:true,
  733. // items:[{
  734. // icon: '../../res/img/common/forum.gif',
  735. // tooltip: '报警外呼记录',
  736. // handler: function(grid, rowIndex, colIndex) {
  737. // var rec = grid.getStore().getAt(rowIndex);
  738. // window.location = 'version.jsp?theme='+theme+'&uqCategory='+rec.get('UQ_CATEGORY')+'&companyId='+rec.get('UQ_CATEGORY');
  739. // }
  740. // }]
  741. // }
  742. ],
  743. columnLines: true,
  744. tbar: [
  745. {
  746. xtype: 'button',
  747. iconCls:'filter_btn',
  748. text: '筛选',
  749. listeners: {
  750. click: filterwin
  751. }
  752. },'-',
  753. {xtype: 'tbfill'},'-',
  754. {
  755. xtype: 'button',
  756. iconCls:'append_btn',
  757. text: '新增',
  758. listeners: {
  759. click: appendwin
  760. }
  761. },
  762. {
  763. xtype: 'button',
  764. iconCls:'modify_btn',
  765. text: '修改',
  766. listeners: {
  767. click: chk_sm
  768. }
  769. },
  770. {
  771. xtype: 'button',
  772. iconCls:'delete_btn',
  773. text: '注销',
  774. listeners: {
  775. click: deletewin
  776. }
  777. }
  778. ],
  779. height: maxHeight,
  780. width: '100%',
  781. bbar: new Ext.PagingToolbar({
  782. store: myStore,
  783. id:'OutcryPackageListPageToolbar',
  784. displayInfo: true,
  785. pageSize: countPerPage,
  786. prependButtons: true,
  787. displayMsg : '显示第 {0}条到 {1}条记录,总共 {2}条',
  788. emptyMsg : "没有记录",
  789. firstText: '第一页',
  790. prevText: '前一页',
  791. nextText: '后一页',
  792. lastText: '最后一页',
  793. refreshText: '刷新',
  794. // doRefresh:function(start){
  795. // alert(start);
  796. // relushDataFunction(start); // 调用函数刷新数据
  797. // this.cursor = start; // 更新页签
  798. // }
  799. }),
  800. frame: true,
  801. border:false,
  802. iconCls: 'icon-grid',
  803. renderTo: Ext.getBody()
  804. });
  805. myStore.reload();
  806. maxHeight = document.documentElement.clientHeight;
  807. Ext.getCmp('OutcryPackageListPanel').setHeight(maxHeight);
  808. });