FireStationOption.js 61 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711
  1. /**
  2. *
  3. */
  4. Ext.Loader.setConfig({
  5. enabled: true
  6. });
  7. Ext.Loader.setPath('Ext.ux', '../../res/extjs/examples/ux');
  8. Ext.require([
  9. 'Ext.grid.*',
  10. 'Ext.data.*',
  11. 'Ext.ux.RowExpander',
  12. 'Ext.selection.CheckboxModel'
  13. ]);
  14. var StatusStore;
  15. var baseUrl;
  16. var centerLng;
  17. var centerLat;
  18. var company_code;
  19. var theme;
  20. var ConfirmStore
  21. var pieWidth;
  22. var showAlarm = null;
  23. var pieMask;
  24. var V_LOGINNAME = '', V_PASSWORD = '';
  25. var maxHeight = 10000;
  26. var maxWidth = 10000;
  27. var companyName = null;
  28. var sm = Ext.create('Ext.selection.CheckboxModel');
  29. Ext.define('FireStationOption', {
  30. extend: 'Ext.data.Model',
  31. fields: [
  32. {name: 'id', type: 'int'},
  33. {name: 'company', type: 'string'},
  34. {name: 'companyCode', type: 'string'},
  35. {name: 'fireSataionName', type: 'string'},
  36. {name: 'addr', type: 'string'},
  37. {name: 'phone', type: 'string'},
  38. {name: 'area', type: 'string'},
  39. {name: 'type', type: 'int'},
  40. {name: 'status', type: 'int'},
  41. {name: 'baifirehosenozzle', type: 'int'},
  42. {name: 'firehose', type: 'int'},
  43. {name: 'abc', type: 'int'},
  44. {name: 'turnouts', type: 'int'},
  45. {name: 'firehat', type: 'int'},
  46. {name: 'firefightersboots', type: 'int'},
  47. {name: 'entrytool', type: 'int'},
  48. {name: 'firecar', type: 'int'},
  49. {name: 'zd', type: 'string'},
  50. {name: 'zz', type: 'string'},
  51. {name: 'stationMaster', type: 'string'},
  52. {name: 'stationMasterPhoen', type: 'string'},
  53. {name: 'insertTime', type: 'string'},
  54. {name: 'dd', type: 'string'}
  55. ]
  56. });
  57. Ext.define('CompanyComboStore', {
  58. extend: 'Ext.data.Model',
  59. fields: [
  60. // {name:'company', type:'string'},
  61. // {name:'companyCode',type:'string'}
  62. {name: 'owner_name', type: 'string'},
  63. {name: 'owner_id', type: 'string'}
  64. ]
  65. });
  66. var draw_confirm = function () {
  67. if (companyName != null)
  68. $("#FirePiePanel_title_string").html(companyName + '.单位微型消防站列表');
  69. else
  70. $("#FirePiePanel_title_string").html('单位微型消防站列表');
  71. var themecolor = ((theme == '') || (theme == 'access')) ? '#ffffff' : '#000000';
  72. for (var i = 0; i < ConfirmStore.length; i++) {
  73. if (ConfirmStore[i].id == 'efire_alarm') {
  74. var mColor = '#34abf5';//[ '#DDDF0D','#f66167', '#34abf5']
  75. var percent = 100;
  76. if (ConfirmStore[i].count > 0)
  77. percent = Number(((ConfirmStore[i].sum * 100) / ConfirmStore[i].count).toString().match(/^\d+(?:\.\d{0,2})?/));
  78. if (percent < 60)
  79. mColor = '#f66167';
  80. else if (percent < 80)
  81. mColor = '#DDDF0D';
  82. $("#operation_num_1").html(ConfirmStore[i].count);
  83. $("#operation_num_2").html(ConfirmStore[i].sum);
  84. $("#operation_num_3").html(ConfirmStore[i].count - ConfirmStore[i].sum);
  85. $("#operation_num_4").html(percent);
  86. // draw_cycle_icon('firePie3','告警处理情况<br/>告警总数:<span style="color:#DDDF0D;text-shadow: 1px 1px 2px #888, 0 0 0 #000">'+ConfirmStore[i].count+'</span><br/>已处理:<span style="color:#34abf5;text-shadow: 1px 1px 2px #888, 0 0 0 #000">'+ConfirmStore[i].sum+'</span><br/>未处理:<span style="color:#DF5353;text-shadow: 1px 1px 2px #888, 0 0 0 #000">'+(ConfirmStore[i].count-ConfirmStore[i].sum)+'</span><br/>处理率:',ConfirmStore[i].count,ConfirmStore[i].sum,themecolor);
  87. Highcharts.getOptions().colors = Highcharts.map(['#DDDF0D', mColor], function (color) {
  88. return {
  89. radialGradient: {cx: 0.5, cy: 0.3, r: 0.7},
  90. stops: [
  91. [0, color],
  92. [1, Highcharts.Color(color).brighten(-0.3).get('rgb')] // darken
  93. ]
  94. };
  95. });
  96. Highcharts.chart('operation_pie', {
  97. chart: {
  98. type: 'solidgauge',
  99. height: '100%',
  100. backgroundColor: 'rgba(0,0,0,0)',
  101. animation: false
  102. },
  103. title: {
  104. text: percent + '%',
  105. floating: true,
  106. y: 90,
  107. style: {fontSize: '16px', color: themecolor, fontWeight: 'bold'}
  108. },
  109. exporting: {
  110. enabled: false
  111. },
  112. credits: {
  113. enabled: false
  114. },
  115. tooltip: {
  116. enabled: false
  117. },
  118. pane: {
  119. startAngle: 0,
  120. background: [{
  121. outerRadius: '110%',
  122. innerRadius: '55%',
  123. backgroundColor: 'rgba(0,0,0,0)',
  124. borderWidth: 0
  125. }]
  126. },
  127. yAxis: {
  128. min: 0,
  129. max: 100,
  130. lineWidth: 0,
  131. tickPositions: []
  132. },
  133. plotOptions: {
  134. solidgauge: {
  135. dataLabels: {
  136. enabled: false
  137. },
  138. linecap: 'square',
  139. stickyTracking: false,
  140. rounded: false,
  141. warp: false
  142. },
  143. series: {
  144. animation: false
  145. }
  146. },
  147. series: [{
  148. name: name,
  149. data: [{
  150. color: 'rgba(0,0,0,0.3)',
  151. radius: '110%',
  152. innerRadius: '60%',
  153. y: 100
  154. }, {
  155. color: (Highcharts.theme && Highcharts.theme.contrastTextColor),
  156. radius: '110%',
  157. innerRadius: '60%',
  158. y: percent
  159. }]
  160. }]
  161. });
  162. Highcharts.getOptions().colors = Highcharts.map(['#f66167', '#34abf5'], function (color) {
  163. return {
  164. linearGradient: {x1: 0, x2: 0, y1: 0, y2: 1},
  165. stops: [
  166. [0, color],
  167. [1, Highcharts.Color(color).setOpacity(0).get('rgb')] // darken
  168. ]
  169. };
  170. });
  171. Highcharts.chart('operation_area', {
  172. chart: {
  173. type: 'area',
  174. // zoomType: 'x',
  175. backgroundColor: 'rgba(0,0,0,0)'
  176. },
  177. color: ['#f66167', '#34abf5'],
  178. title: {
  179. text: (companyName != null) ? companyName + '.电气火灾监控告警处理情况跟踪' : '电气火灾监控告警处理情况跟踪',
  180. float: true,
  181. style: {fontSize: '14px', color: themecolor, fontWeight: 'bold'},
  182. enabled: false
  183. },
  184. legend: {
  185. // enabled:false,
  186. floating: true,
  187. x: 410,
  188. y: -210,
  189. itemStyle: {fontSize: '12px', color: themecolor, fontWeight: 'bold'}
  190. },
  191. // colors:['#f66167', '#34abf5'],
  192. exporting: {
  193. enabled: false
  194. },
  195. credits: {
  196. enabled: false
  197. },
  198. xAxis: {
  199. categories: ConfirmStore[i].day_list,
  200. tickmarkPlacement: 'on',
  201. gridLineWidth: 0,
  202. labels: {
  203. enabled: false,
  204. style: {fontSize: '10px', color: themecolor, fontWeight: 'bold'}
  205. },
  206. title: {
  207. enabled: false
  208. }
  209. },
  210. yAxis: {
  211. title: {
  212. enabled: false,
  213. text: '次',
  214. style: {fontSize: '10px', color: themecolor, fontWeight: 'bold'}
  215. },
  216. gridLineWidth: 1,
  217. gridLineColor: 'rgba(0,0,0,0.2)',
  218. labels: {
  219. // enabled:false,
  220. formatter: this.value,
  221. style: {fontSize: '10px', color: themecolor, fontWeight: 'bold'}
  222. }
  223. },
  224. plotOptions: {
  225. area: {
  226. stackiung: 'normal',
  227. // fillOpacity:0.1,
  228. // lineColor:'#666666',
  229. // lineWidth:1,
  230. marker: {
  231. lineWidth: 0,
  232. enabled: false,
  233. radius: 0
  234. // lineColor:'#666666'
  235. }
  236. }
  237. },
  238. series: [
  239. {
  240. name: '告警次数',
  241. data: ConfirmStore[i].count_list,
  242. lineWidth: 1,
  243. lineColor: '#f66167',
  244. fillColor: {
  245. linearGradient: {
  246. x1: 0,
  247. y1: 0,
  248. x2: 0,
  249. y2: 1
  250. },
  251. stops: [
  252. [0, '#f66167'],
  253. [1, Highcharts.Color('#f66167').setOpacity(0.3).get('rgba')]
  254. ]
  255. }
  256. }, {
  257. name: '处理次数',
  258. data: ConfirmStore[i].sum_list,
  259. lineWidth: 1,
  260. lineColor: '#34abf5',
  261. fillColor: {
  262. linearGradient: {
  263. x1: 0,
  264. y1: 0,
  265. x2: 0,
  266. y2: 1
  267. },
  268. stops: [
  269. [0, '#34abf5'],
  270. [1, Highcharts.Color('#34abf5').setOpacity(0.3).get('rgba')]
  271. ]
  272. },
  273. }
  274. ]
  275. });
  276. }
  277. }
  278. }
  279. var draw_cycle_icon = function (icon_id, name, total, num, themecolor) {
  280. var mColor = '#34abf5';//[ '#DDDF0D','#f66167', '#34abf5']
  281. var percent = 100;
  282. if (total > 0)
  283. percent = Number(((num * 100) / total).toString().match(/^\d+(?:\.\d{0,2})?/));
  284. if (percent < 60)
  285. mColor = '#f66167';
  286. else if (percent < 80)
  287. mColor = '#DDDF0D';
  288. $("#" + icon_id + "Title").html('<br/><br/>' + name + percent + '%');
  289. Highcharts.getOptions().colors = Highcharts.map(['#000000', mColor, mColor], function (color) {
  290. return {
  291. radialGradient: {cx: 0.5, cy: 0.3, r: 0.7},
  292. stops: [
  293. [0, color],
  294. [1, Highcharts.Color(color).brighten(-0.3).get('rgb')] // darken
  295. ]
  296. };
  297. });
  298. Highcharts.chart(icon_id, {
  299. chart: {
  300. type: 'solidgauge',
  301. height: '85%',
  302. backgroundColor: 'rgba(50,11,11,0)',
  303. reflow: true,
  304. marginTop: 0
  305. },
  306. title: {
  307. text: percent + '%',
  308. floating: true,
  309. y: (pieWidth * 2 / 5),
  310. style: {fontSize: '21px', color: themecolor, fontWeight: 'bold'}
  311. },
  312. exporting: {
  313. enabled: false
  314. },
  315. credits: {
  316. enabled: false
  317. },
  318. tooltip: {
  319. enabled: false
  320. },
  321. pane: {
  322. startAngle: -90,
  323. endAngle: 270,
  324. background: [{
  325. outerRadius: '90%',
  326. innerRadius: '60%',
  327. backgroundColor: 'rgba(0,0,0,0)',
  328. borderWidth: 0
  329. }]
  330. },
  331. yAxis: {
  332. min: 0,
  333. max: 100,
  334. lineWidth: 0,
  335. tickPositions: []
  336. },
  337. plotOptions: {
  338. solidgauge: {
  339. dataLabels: {
  340. enabled: false
  341. },
  342. linecap: 'square',
  343. stickyTracking: false,
  344. rounded: false,
  345. warp: false
  346. }
  347. },
  348. series: [{
  349. name: '',
  350. data: [{
  351. color: Highcharts.Color(mColor)
  352. .setOpacity(0.2)
  353. .get(),
  354. radius: '110%',
  355. innerRadius: '80%',
  356. y: 100
  357. }, {
  358. color: (Highcharts.theme && Highcharts.theme.contrastTextColor),
  359. radius: '110%',
  360. innerRadius: '80%',
  361. y: percent
  362. }, {
  363. color: (Highcharts.theme && Highcharts.theme.contrastTextColor),
  364. radius: '60%',
  365. innerRadius: '0%',
  366. y: 100
  367. }]
  368. }]
  369. });
  370. if ((theme == 'access') || (theme == '')) {
  371. $('#' + icon_id).addClass('shadow_black');
  372. } else {
  373. $('#' + icon_id).addClass('shadow_white');
  374. }
  375. }
  376. var getCurrentData = function () {
  377. var query = new Object();
  378. query.V_LOGINNAME = V_LOGINNAME;
  379. query.V_PASSWORD = V_PASSWORD;
  380. query.dwtype = '7';
  381. query.COMMSTATUS = 'NO';
  382. if ((company_code != null) && (company_code != 'null') && (company_code.length > 0))
  383. query.company_code = company_code;
  384. // pieMask.show();
  385. $.ajax({
  386. type: 'POST',
  387. url: baseUrl + "iot/alarm/view/getConfirmStatusByDays",
  388. data: {
  389. queryJson: Ext.JSON.encode(query)
  390. },
  391. success: function (result) {
  392. var json = eval('(' + result + ')');
  393. if (json.action == 'getConfirmStatusByDays') {
  394. if (json.check == 'true') {
  395. ConfirmStore = json.RESULT;
  396. if (json.company_name != null)
  397. companyName = json.company_name;
  398. else
  399. companyName = null;
  400. draw_confirm();
  401. } else {
  402. Ext.Msg.alert('错误信息', '访问权限错误,请重新登录', function () {
  403. window.parent.frames.return_login();
  404. });
  405. }
  406. }
  407. pieMask.hide();
  408. }
  409. });
  410. }
  411. var body_resize = function () {
  412. maxHeight = document.documentElement.clientHeight;
  413. maxWidth = document.documentElement.clientWidth;
  414. Ext.getCmp('FireAlarmPanel').setHeight(maxHeight);
  415. Ext.getCmp('FireAlarmPanel').setWidth(maxWidth);
  416. }
  417. function exportbtn_click() {
  418. V_LOGINNAME = $("#V_LOGINNAME").val();
  419. company_code = document.getElementById('company_code').value;
  420. clzt = document.getElementById('clzt').value;
  421. time_start = document.getElementById('time_start').value;
  422. time_end = document.getElementById('time_end').value;
  423. var fields = '';
  424. var array = ['id', 'company_name', 'device_code', 'name', 'data1', 'clr', 'clnr', 'clwb', 'clzt', 'time', 'clsj'];
  425. var name = ['编号', '公司名称', '设备编号', '设备名称', '报警类型', '处理人', '处理内容', '是否误报', '处理状态', '报警时间', '处理时间'];
  426. for (var i = 0; i < 11; i++) {
  427. if (i > 0)
  428. fields += ',';
  429. fields += '{id:"' + array[i] + '",title:"' + name[i] + '",shown:"' + true + '"}';
  430. }
  431. var query = new Object();
  432. query.V_LOGINNAME = V_LOGINNAME;
  433. query.company_code = company_code;
  434. query.status = status;
  435. query.time_start = time_start;
  436. query.time_end = time_end;
  437. query.COMMSTATUS = 'NO';
  438. query.EXPORT_FILE = '电气火灾告警数据列表';
  439. query.fields = '[' + fields + ']';
  440. $.ajax({
  441. type: 'POST',
  442. url: baseUrl + "iot/excel/view/EfireAlarmExcel",
  443. data: {
  444. queryJson: Ext.JSON.encode(query)
  445. },
  446. success: function (result) {
  447. var json = eval('(' + result + ')');
  448. if (json.action == 'dormExport') {
  449. ConfirmStore = json.RESULT;
  450. var elemIF = document.createElement("iframe");
  451. elemIF.src = baseUrl + json.filename;
  452. elemIF.style.display = "none";
  453. document.body.appendChild(elemIF);
  454. }
  455. }
  456. });
  457. }
  458. Ext.onReady(function () {
  459. baseUrl = document.getElementById('basePath').value;
  460. theme = document.getElementById('theme').value;
  461. company_code = document.getElementById('company_code').value;
  462. $("#V_LOGINNAME").val(sessionStorage.getItem('V_LOGINNAME'));
  463. $("#V_PASSWORD").val(sessionStorage.getItem('V_PASSWORD'));
  464. V_LOGINNAME = $("#V_LOGINNAME").val();
  465. V_PASSWORD = $("#V_PASSWORD").val();
  466. var currentWidth = document.documentElement.clientWidth;
  467. pieWidth = currentWidth / 7;
  468. var chkIcon = '<img src="' + baseUrl + 'res/img/common/check.gif"/>'
  469. var unchkIcon = '<img src="' + baseUrl + 'res/img/common/uncheck.gif"/>'
  470. var countPerPage = 30;
  471. var chkBoolean = function (flag) {
  472. if (flag)
  473. return chkIcon;
  474. return unchkIcon;
  475. }
  476. var queryJson = new Object();
  477. queryJson.V_LOGINNAME = V_LOGINNAME;
  478. queryJson.V_PASSWORD = V_PASSWORD;
  479. queryJson.COMMSTATUS = 'NO';
  480. if ((company_code != null) && (company_code != 'null') && (company_code.length > 0))
  481. queryJson.company_code = company_code;
  482. var myStore = Ext.create('Ext.data.Store', {
  483. model: 'FireStationOption',
  484. pageSize: countPerPage,
  485. proxy: {
  486. type: 'ajax',
  487. actionMethods: {
  488. create: 'POST',
  489. read: 'POST', // by default GET
  490. update: 'POST',
  491. destroy: 'POST'
  492. },
  493. url: baseUrl + 'FireStationController/queryFireStation',
  494. reader: {
  495. type: 'json',
  496. root: 'RESULT',
  497. totalProperty: 'totalCount'
  498. },
  499. extraParams: {
  500. queryJson: Ext.JSON.encode(queryJson)
  501. }
  502. },
  503. sorters: [{
  504. property: 'time',
  505. direction: 'DESC'
  506. }],
  507. remoteSort: true
  508. });
  509. myStore.on("load", function (myStore) {
  510. getCurrentData();
  511. //do something
  512. });
  513. var CompanyStory = Ext.create('Ext.data.Store', {
  514. model: 'CompanyComboStore',
  515. proxy: {
  516. type: 'ajax',
  517. actionMethods: {
  518. create: 'POST',
  519. read: 'POST', // by default GET
  520. update: 'POST',
  521. destroy: 'POST'
  522. },
  523. url: baseUrl + 'iot/company/view/getNameList',
  524. //url: baseUrl+'iot/company/view/getNameList',
  525. reader: {
  526. type: 'json',
  527. root: 'RESULT',
  528. totalProperty: 'totalCount'
  529. },
  530. extraParams: {
  531. queryJson: Ext.JSON.encode(queryJson)
  532. }
  533. }
  534. });
  535. var ClztStory = Ext.create('Ext.data.Store', {
  536. fields: ['status', 'name'],
  537. data: [
  538. {'status': '0', 'name': '未启用'},
  539. {'status': '1', 'name': '启用'}
  540. ]
  541. });
  542. var FilterForm = Ext.create('Ext.form.Panel', {
  543. id: 'VFireOptionFilterForm',
  544. labelWidth: 55,
  545. defaultType: 'textfield',
  546. bodyPadding: 15,
  547. items: [{
  548. xtype: 'combo',
  549. fieldLabel: '单位名称',
  550. id: 'ff_company_code',
  551. name: 'ff_company_code',
  552. displayField: 'owner_name',
  553. valueField: 'owner_id',
  554. editable: false,
  555. width: 330,
  556. store: CompanyStory
  557. },
  558. /* {
  559. xtype:'combo',
  560. fieldLabel:'单位名称',
  561. id: 'ff_company_code',
  562. name:'ff_company_code',
  563. displayField : 'owner_name',
  564. valueField : 'owner_id',
  565. allowBlank:false,
  566. blankText:"不能为空",
  567. editable : false,
  568. width:330,
  569. store:CompanyStory
  570. },*/
  571. {
  572. xtype: 'combo',
  573. fieldLabel: '启用状态',
  574. id: 'ff_qyzt',
  575. name: 'ff_qyzt',
  576. displayField: 'name',
  577. valueField: 'status',
  578. editable: false,
  579. width: 330,
  580. store: ClztStory
  581. }],
  582. buttons: [{
  583. text: '筛选',
  584. iconCls: 'ok_btn',
  585. handler: function () {
  586. var form = this.up('form').getForm();
  587. if (form.isValid()) {
  588. var query = new Object();
  589. // var tmp = Ext.getCmp('ff_company_code');
  590. if (Ext.getCmp('ff_company_code').getValue()) {
  591. query.company_code = Ext.getCmp('ff_company_code').getValue();
  592. $("#company_code").val(query.company_code);
  593. company_code = query.company_code;
  594. $("#FirePiePanel_title_string").html(Ext.getCmp('ff_company_code').getRawValue() + '.单位微型消防站列表');
  595. } else {
  596. $("#company_code").val('');
  597. $("#FirePiePanel_title_string").html('单位微型消防站列表');
  598. company_code = null;
  599. }
  600. if (Ext.getCmp('ff_qyzt').getValue()) {
  601. query.status = Ext.getCmp('ff_qyzt').getValue();
  602. $("#status").val(query.status);
  603. } else {
  604. $("#status").val('');
  605. }
  606. query.status = Ext.getCmp('ff_qyzt').getValue() == null ? "" : Ext.getCmp('ff_qyzt').getValue();
  607. query.V_LOGINNAME = V_LOGINNAME;
  608. query.V_PASSWORD = V_PASSWORD;
  609. query.COMMSTATUS = 'NO';
  610. var jsonstr = Ext.JSON.encode(query);
  611. myStore.getProxy().extraParams = {
  612. queryJson: jsonstr
  613. };
  614. Ext.getCmp('FireStationListPageToolbar').moveFirst();
  615. Ext.getCmp('ff_company_code').setValue('');
  616. Ext.getCmp('ff_qyzt').setValue('');
  617. Ext.getCmp('VFireOptionFilterWin').hide();
  618. // getCurrentData();
  619. }
  620. }
  621. }, {
  622. text: '关闭',
  623. iconCls: 'cancel_btn',
  624. handler: function () {
  625. Ext.getCmp('VFireOptionFilterWin').hide();
  626. }
  627. }]
  628. });
  629. //筛选弹框
  630. var filterwin = function () {
  631. Ext.create('Ext.window.Window', {
  632. id: 'VFireOptionFilterWin',
  633. title: '单位消防站筛选',
  634. height: 210,
  635. width: 400,
  636. layout: 'fit',
  637. items: FilterForm,
  638. closable: false,
  639. modal: true,
  640. closeAction: 'hide'
  641. }).show();
  642. CompanyStory.reload();
  643. }
  644. var radiogroup = new Ext.create('Ext.form.RadioGroup', {
  645. fieldLabel: '微站类型',
  646. id: 'stationType',
  647. width: 300,
  648. items: [{
  649. name: 'stationType',
  650. inputValue: '1',
  651. boxLabel: '重点',
  652. }, {
  653. name: 'stationType',
  654. inputValue: '0',
  655. boxLabel: '社区微站',
  656. //checked:
  657. }]
  658. });
  659. var radiogroup2 = new Ext.create('Ext.form.RadioGroup', {
  660. fieldLabel: '启用状态',
  661. id: 'stationStatus',
  662. width: 300,
  663. items: [{
  664. name: 'stationStatus',
  665. inputValue: '1',
  666. boxLabel: '启用'
  667. }, {
  668. name: 'stationStatus',
  669. inputValue: '0',
  670. boxLabel: '未启用',
  671. // checked:true
  672. }]
  673. });
  674. var but =Ext.create('Ext.Button', {
  675. text: '详情',
  676. listeners: {
  677. blur : function() {
  678. Ext.create('Ext.window.Window', {
  679. id: 'VFireOptionFilterWin',
  680. title: '单位消防站筛选',
  681. height: 210,
  682. width: 400,
  683. layout: 'fit',
  684. items: FilterForm,
  685. closable: false,
  686. modal: true,
  687. closeAction: 'hide'
  688. }).show();
  689. }
  690. }
  691. })
  692. var childPanel2 = Ext.create('Ext.Panel', {
  693. html: '==========================基本信息==================='
  694. });
  695. var clear_modify_form = function () {
  696. Ext.getCmp('fireSataionName').setValue('');
  697. Ext.getCmp('company').setValue('');
  698. Ext.getCmp('addr').setValue('');
  699. Ext.getCmp('id').setValue('');
  700. Ext.getCmp('stationStatus').setValue('');
  701. Ext.getCmp('phone').setValue('');
  702. Ext.getCmp('stationType').setValue('');
  703. Ext.getCmp('area').setValue('');
  704. // Ext.getCmp('uf_clsj').setValue('');
  705. Ext.getCmp('firehose').setValue('');
  706. }
  707. var clear_add_form = function () {
  708. Ext.getCmp('addfireSataionName').setValue('');
  709. // Ext.getCmp('addcompany').setValue('');
  710. Ext.getCmp('addfm_companyCode').setValue('');
  711. Ext.getCmp('addaddr').setValue('');
  712. Ext.getCmp('addid').setValue('');
  713. Ext.getCmp('addphone').setValue('');
  714. Ext.getCmp('addarea').setValue('');
  715. Ext.getCmp('addbaifirehosenozzle').setValue('');
  716. Ext.getCmp('addfirehose').setValue('');
  717. Ext.getCmp('addabc').setValue('');
  718. Ext.getCmp('addturnouts').setValue('');
  719. Ext.getCmp('addfirehat').setValue('');
  720. Ext.getCmp('addfirefightersboots').setValue('');
  721. Ext.getCmp('addfirecar').setValue('');
  722. Ext.getCmp('addentrytool').setValue('');
  723. Ext.getCmp('addzd').setValue('');
  724. Ext.getCmp('adddd').setValue('');
  725. Ext.getCmp('addzz').setValue('');
  726. Ext.getCmp('addstationMaster').setValue('');
  727. Ext.getCmp('addstationMasterPhoen').setValue('');
  728. }
  729. var fireInfoForm = Ext.create('Ext.form.Panel', {
  730. id: 'fireInfoForm',
  731. labelWidth: 55,
  732. layout: "column",
  733. url: baseUrl + 'FireStationController/updataFireStation',
  734. defaultType: 'textfield',
  735. bodyPadding: 15,
  736. items: [{
  737. fieldLabel: '消防站名称',
  738. id: 'fireSataionName',
  739. name: 'fireSataionName',
  740. anchor: '100%'
  741. }, {
  742. fieldLabel: '所属单位',
  743. id: 'company',
  744. name: 'company',
  745. anchor: '100%'
  746. },
  747. {
  748. fieldLabel: '单位编号',
  749. id: 'fm_companyCode',
  750. name: 'companyCode',
  751. anchor: '100%',
  752. hidden: true
  753. }, {
  754. fieldLabel: '记录编号',
  755. id: 'id',
  756. name: 'id',
  757. hidden: true
  758. }, {
  759. fieldLabel: '值班电话',
  760. id: 'phone',
  761. name: 'phone',
  762. xtype: 'textareafield',
  763. maxLength: 13,
  764. anchor: '100%'
  765. }, {
  766. fieldLabel: '详细地址',
  767. id: 'addr',
  768. name: 'addr',
  769. maxLength: 120,
  770. anchor: '65%'
  771. }, radiogroup, radiogroup2, {
  772. fieldLabel: '所属区域',
  773. id: 'area',
  774. name: 'area',
  775. maxLength: 120,
  776. anchor: '65%'
  777. }, {
  778. fieldLabel: '水枪数量/只',
  779. id: 'baifirehosenozzle',
  780. name: 'baifirehosenozzle',
  781. maxLength: 50,
  782. anchor: '15%'
  783. }, {
  784. fieldLabel: '水带/条',
  785. id: 'firehose',
  786. name: 'firehose',
  787. maxLength: 50,
  788. anchor: '15%'
  789. }, {
  790. fieldLabel: '灭火器/个',
  791. id: 'abc',
  792. name: 'abc',
  793. maxLength: 50,
  794. anchor: '15%',
  795. },but,{
  796. fieldLabel: '防护服/件',
  797. id: 'turnouts',
  798. name: 'turnouts',
  799. maxLength: 50,
  800. anchor: '15%'
  801. }, {
  802. fieldLabel: '消防头盔/个',
  803. id: 'firehat',
  804. name: 'firehat',
  805. maxLength: 50,
  806. anchor: '15%'
  807. }, {
  808. fieldLabel: '消防靴/双',
  809. id: 'firefightersboots',
  810. name: 'firefightersboots',
  811. maxLength: 50,
  812. anchor: '15%'
  813. }, {
  814. fieldLabel: '消防车/辆',
  815. id: 'firecar',
  816. name: 'firecar',
  817. maxLength: 50,
  818. anchor: '15%'
  819. }, {
  820. fieldLabel: '破拆工具/套',
  821. id: 'entrytool',
  822. name: 'entrytool',
  823. maxLength: 50,
  824. anchor: '15%'
  825. }, {
  826. fieldLabel: '辖区支队',
  827. id: 'zd',
  828. name: 'zd',
  829. maxLength: 50,
  830. anchor: '50%'
  831. }, {
  832. fieldLabel: '辖区大队',
  833. id: 'dd',
  834. name: 'dd',
  835. maxLength: 50,
  836. anchor: '50%'
  837. }, {
  838. fieldLabel: '辖区中队',
  839. id: 'zz',
  840. name: 'zz',
  841. maxLength: 50,
  842. anchor: '50%'
  843. }, {
  844. fieldLabel: '站长',
  845. id: 'stationMaster',
  846. name: 'stationMaster',
  847. maxLength: 50,
  848. anchor: '25%'
  849. }, {
  850. fieldLabel: '站长电话',
  851. id: 'stationMasterPhoen',
  852. name: 'stationMasterPhoen',
  853. anchor: '50%'
  854. }, {
  855. fieldLabel: '添加时间',
  856. id: 'insertTime',
  857. name: 'insertTime',
  858. maxLength: 50,
  859. anchor: '55%'
  860. },
  861. {
  862. id: 'fm_queryJson',
  863. name: 'queryJson',
  864. hidden: true
  865. }
  866. ],
  867. buttons: [{
  868. text: '修改',
  869. id: 'confirmBtn',
  870. iconCls: 'ok_btn',
  871. handler: function () {
  872. var form = this.up('form').getForm();
  873. if (form.isValid()) {
  874. var queryJson = new Object();
  875. queryJson.V_LOGINNAME = V_LOGINNAME;
  876. queryJson.V_PASSWORD = V_PASSWORD;
  877. queryJson.id = Ext.getCmp('id').getValue();
  878. queryJson.company = Ext.getCmp('company').getValue();
  879. queryJson.addr = Ext.getCmp('addr').getValue();
  880. queryJson.status = Ext.getCmp('stationStatus').getChecked()[0].boxLabel == '启用' ? 1 : 0;
  881. queryJson.type = Ext.getCmp('stationType').getChecked()[0].boxLabel == '重点' ? 1 : 0;
  882. queryJson.firehose = Ext.getCmp('firehose').getValue();
  883. //===============================================================
  884. queryJson.phone = Ext.getCmp('phone').getValue();
  885. queryJson.fireSataionName = Ext.getCmp('fireSataionName').getValue();
  886. queryJson.companyCode = Ext.getCmp('fm_companyCode').getValue();
  887. // queryJson.type = Ext.getCmp('type').getValue();
  888. queryJson.area = Ext.getCmp('area').getValue();
  889. queryJson.baifirehosenozzle = Ext.getCmp('baifirehosenozzle').getValue();
  890. queryJson.abc = Ext.getCmp('abc').getValue();
  891. queryJson.turnouts = Ext.getCmp('turnouts').getValue();
  892. queryJson.firefightersboots = Ext.getCmp('firefightersboots').getValue();
  893. queryJson.entrytool = Ext.getCmp('entrytool').getValue();
  894. queryJson.firecar = Ext.getCmp('firecar').getValue();
  895. queryJson.firehat = Ext.getCmp('firehat').getValue();
  896. queryJson.zd = Ext.getCmp('zd').getValue();
  897. queryJson.dd = Ext.getCmp('dd').getValue();
  898. queryJson.zz = Ext.getCmp('zz').getValue();
  899. queryJson.stationMaster = Ext.getCmp('stationMaster').getValue();
  900. queryJson.stationMasterPhoen = Ext.getCmp('stationMasterPhoen').getValue();
  901. queryJson.insertTime = Ext.getCmp('insertTime').getValue();
  902. //==========================================================
  903. var jsonstr = Ext.JSON.encode(queryJson);
  904. Ext.getCmp('fm_queryJson').setValue(jsonstr);
  905. form.submit({
  906. method: 'post',
  907. success: function (form, action) {
  908. Ext.Msg.alert('操作成功', '已确认1条记录', function (btn, txt) {
  909. clear_modify_form();
  910. myStore.reload();
  911. // getCurrentData();
  912. });
  913. },
  914. failure: function (form, action) {
  915. Ext.Msg.alert('操作失败', action.Msg, function (btn, txt) {
  916. clear_modify_form();
  917. myStore.reload();
  918. // getCurrentData();
  919. });
  920. }
  921. });
  922. this.up('window').close();
  923. }
  924. }
  925. }, {
  926. text: '关闭',
  927. iconCls: 'cancel_btn',
  928. handler: function () {
  929. this.up('window').close();
  930. }
  931. }]
  932. });
  933. var vFileInfoWin = Ext.create('Ext.window.Window', {
  934. id: 'VFileInfoWin',
  935. title: '微型消防站信息: <span id="VInfoWin_Title"></span>',
  936. width: 928,
  937. layout: 'fit',
  938. closable: false,
  939. modal: true,
  940. closeAction: 'hide',
  941. items: fireInfoForm
  942. });
  943. var addwin = function () {
  944. Ext.create('Ext.window.Window', {
  945. title: '新增单位微型消防站',
  946. height: 405,
  947. width: 945,
  948. layout: 'fit',
  949. items: addfireInfoForm,
  950. closable: false,
  951. modal: true,
  952. closeAction: 'hide'
  953. }).show();
  954. //CompanyStory.reload();
  955. }
  956. //================================================
  957. var addradiogroup = new Ext.create('Ext.form.RadioGroup', {
  958. fieldLabel: '微站类型',
  959. id: 'addstationType',
  960. width: 300,
  961. items: [{
  962. name: 'stationType',
  963. inputValue: '1',
  964. boxLabel: '重点',
  965. }, {
  966. name: 'stationType',
  967. inputValue: '0',
  968. boxLabel: '社区微站',
  969. //checked:
  970. }]
  971. });
  972. var addradiogroup2 = new Ext.create('Ext.form.RadioGroup', {
  973. fieldLabel: '启用状态',
  974. id: 'addstationStatus',
  975. width: 300,
  976. items: [{
  977. name: 'stationStatus',
  978. inputValue: '1',
  979. boxLabel: '启用'
  980. }, {
  981. name: 'stationStatus',
  982. inputValue: '0',
  983. boxLabel: '未启用',
  984. // checked:true
  985. }]
  986. });
  987. var fireStationInfoForm = Ext.create('Ext.form.Panel', {
  988. id: 'fireStationInfoForm',
  989. labelWidth: 55,
  990. layout: "column",
  991. url: baseUrl + 'FireStationController/fireStationInfoForm',
  992. defaultType: 'textfield',
  993. bodyPadding: 15,
  994. items: [{
  995. fieldLabel: '消防站名称',
  996. id: 'addfireSataionName',
  997. name: 'fireSataionName',
  998. allowBlank: false,
  999. blankText: "不能为空",
  1000. anchor: '100%'
  1001. },
  1002. {
  1003. xtype: 'combo',
  1004. fieldLabel: '单位名称',
  1005. id: 'addfm_companyCode',
  1006. name: 'company',
  1007. displayField: 'owner_name',
  1008. valueField: 'owner_id',
  1009. allowBlank: false,
  1010. blankText: "不能为空",
  1011. editable: false,
  1012. width: 330,
  1013. store: CompanyStory
  1014. }, {
  1015. fieldLabel: '详细地址',
  1016. allowBlank: false,
  1017. blankText: "不能为空",
  1018. id: 'addaddr',
  1019. name: 'addr',
  1020. hidden: true
  1021. }, {
  1022. fieldLabel: '记录编号',
  1023. id: 'addid',
  1024. name: 'id',
  1025. hidden: true
  1026. }, {
  1027. fieldLabel: '值班电话',
  1028. allowBlank: false,
  1029. blankText: "不能为空",
  1030. id: 'addphone',
  1031. name: 'phone',
  1032. xtype: 'textareafield',
  1033. maxLength: 13,
  1034. anchor: '100%'
  1035. }, {
  1036. fieldLabel: '详情地址',
  1037. allowBlank: false,
  1038. blankText: "不能为空",
  1039. id: 'addaddr',
  1040. name: 'area',
  1041. maxLength: 120,
  1042. anchor: '65%'
  1043. }, addradiogroup, addradiogroup2, {
  1044. fieldLabel: '所属区域',
  1045. id: 'addarea',
  1046. name: 'area',
  1047. maxLength: 120,
  1048. anchor: '65%'
  1049. }, {
  1050. fieldLabel: '水枪数量/只',
  1051. id: 'addbaifirehosenozzle',
  1052. allowBlank: false,
  1053. blankText: "不能为空",
  1054. name: 'baifirehosenozzle',
  1055. maxLength: 50,
  1056. anchor: '15%'
  1057. }, {
  1058. fieldLabel: '水带/条',
  1059. id: 'addfirehose',
  1060. allowBlank: false,
  1061. blankText: "不能为空",
  1062. name: 'firehose',
  1063. maxLength: 50,
  1064. anchor: '15%'
  1065. }, {
  1066. fieldLabel: '灭火器/个',
  1067. allowBlank: false,
  1068. blankText: "不能为空",
  1069. id: 'addabc',
  1070. name: 'abc',
  1071. maxLength: 50,
  1072. anchor: '15%'
  1073. }, {
  1074. fieldLabel: '防护服/件',
  1075. allowBlank: false,
  1076. blankText: "不能为空",
  1077. id: 'addturnouts',
  1078. name: 'turnouts',
  1079. maxLength: 50,
  1080. anchor: '15%'
  1081. }, {
  1082. fieldLabel: '消防头盔/个',
  1083. allowBlank: false,
  1084. blankText: "不能为空",
  1085. id: 'addfirehat',
  1086. name: 'firehat',
  1087. maxLength: 50,
  1088. anchor: '15%'
  1089. }, {
  1090. fieldLabel: '消防靴/双',
  1091. id: 'addfirefightersboots',
  1092. allowBlank: false,
  1093. blankText: "不能为空",
  1094. name: 'firefightersboots',
  1095. maxLength: 50,
  1096. anchor: '15%'
  1097. }, {
  1098. fieldLabel: '消防车/辆',
  1099. id: 'addfirecar',
  1100. name: 'firecar',
  1101. maxLength: 50,
  1102. anchor: '15%'
  1103. }, {
  1104. fieldLabel: '破拆工具/套',
  1105. id: 'addentrytool',
  1106. allowBlank: false,
  1107. blankText: "不能为空",
  1108. name: 'entrytool',
  1109. maxLength: 50,
  1110. anchor: '15%'
  1111. }, {
  1112. fieldLabel: '辖区支队',
  1113. id: 'addzd',
  1114. name: 'zd',
  1115. maxLength: 50,
  1116. anchor: '50%'
  1117. }, {
  1118. fieldLabel: '辖区大队',
  1119. id: 'adddd',
  1120. name: 'dd',
  1121. maxLength: 50,
  1122. anchor: '50%'
  1123. }, {
  1124. fieldLabel: '辖区中队',
  1125. id: 'addzz',
  1126. name: 'zz',
  1127. maxLength: 50,
  1128. anchor: '50%'
  1129. }, {
  1130. fieldLabel: '站长',
  1131. id: 'addstationMaster',
  1132. name: 'stationMaster',
  1133. maxLength: 50,
  1134. anchor: '25%'
  1135. }, {
  1136. fieldLabel: '站长电话',
  1137. id: 'addstationMasterPhoen',
  1138. name: 'stationMasterPhoen',
  1139. anchor: '50%'
  1140. },
  1141. {
  1142. id: 'addfm_queryJson',
  1143. name: 'queryJson',
  1144. hidden: true
  1145. }],
  1146. buttons: [{
  1147. text: '提交',
  1148. id: 'addconfirmBtn',
  1149. iconCls: 'ok_btn',
  1150. handler: function () {
  1151. var form = this.up('form').getForm();
  1152. if (form.isValid()) {
  1153. var queryJson = new Object();
  1154. queryJson.V_LOGINNAME = V_LOGINNAME;
  1155. queryJson.V_PASSWORD = V_PASSWORD;
  1156. queryJson.id = Ext.getCmp('addid').getValue();
  1157. // queryJson.company = Ext.getCmp('addcompany').getValue();
  1158. queryJson.addr = Ext.getCmp('addaddr').getValue();
  1159. queryJson.status = Ext.getCmp('addstationStatus').getChecked()[0].boxLabel == '启用' ? 1 : 0;
  1160. queryJson.type = Ext.getCmp('addstationType').getChecked()[0].boxLabel == '重点' ? 1 : 0;
  1161. queryJson.firehose = Ext.getCmp('addfirehose').getValue();
  1162. //===============================================================
  1163. queryJson.phone = Ext.getCmp('addphone').getValue();
  1164. queryJson.fireSataionName = Ext.getCmp('addfireSataionName').getValue();
  1165. queryJson.companyCode = Ext.getCmp('addfm_companyCode').getValue();
  1166. // queryJson.type = Ext.getCmp('type').getValue();
  1167. queryJson.area = Ext.getCmp('addarea').getValue();
  1168. queryJson.baifirehosenozzle = Ext.getCmp('addbaifirehosenozzle').getValue();
  1169. queryJson.abc = Ext.getCmp('addabc').getValue();
  1170. queryJson.turnouts = Ext.getCmp('addturnouts').getValue();
  1171. queryJson.firefightersboots = Ext.getCmp('addfirefightersboots').getValue();
  1172. queryJson.entrytool = Ext.getCmp('addentrytool').getValue();
  1173. queryJson.firecar = Ext.getCmp('addfirecar').getValue();
  1174. queryJson.firehat = Ext.getCmp('addfirehat').getValue();
  1175. queryJson.zd = Ext.getCmp('addzd').getValue();
  1176. queryJson.dd = Ext.getCmp('adddd').getValue();
  1177. queryJson.zz = Ext.getCmp('addzz').getValue();
  1178. queryJson.stationMaster = Ext.getCmp('addstationMaster').getValue();
  1179. queryJson.stationMasterPhoen = Ext.getCmp('addstationMasterPhoen').getValue();
  1180. // queryJson.insertTime = Ext.getCmp('addinsertTime').getValue();
  1181. //==========================================================
  1182. var jsonstr = Ext.JSON.encode(queryJson);
  1183. Ext.getCmp('addfm_queryJson').setValue(jsonstr);
  1184. form.submit({
  1185. method: 'post',
  1186. success: function (form, action) {
  1187. Ext.Msg.alert('操作成功', '已确认1条记录', function (btn, txt) {
  1188. clear_add_form();
  1189. myStore.reload();
  1190. // getCurrentData();
  1191. });
  1192. },
  1193. failure: function (form, action) {
  1194. Ext.Msg.alert('操作失败', action.Msg, function (btn, txt) {
  1195. clear_add_form();
  1196. myStore.reload();
  1197. //
  1198. });
  1199. }
  1200. });
  1201. this.up('window').close();
  1202. }
  1203. }
  1204. }, {
  1205. text: '关闭',
  1206. iconCls: 'cancel_btn',
  1207. handler: function () {
  1208. clear_add_form();
  1209. this.up('window').close();
  1210. }
  1211. }]
  1212. });
  1213. var addfireInfoForm = Ext.create('Ext.form.Panel', {
  1214. id: 'addfireInfoForm',
  1215. labelWidth: 55,
  1216. layout: "column",
  1217. url: baseUrl + 'FireStationController/addFireStation',
  1218. defaultType: 'textfield',
  1219. bodyPadding: 15,
  1220. items: [{
  1221. fieldLabel: '消防站名称',
  1222. id: 'addfireSataionName',
  1223. name: 'fireSataionName',
  1224. allowBlank: false,
  1225. blankText: "不能为空",
  1226. anchor: '100%'
  1227. },
  1228. {
  1229. xtype: 'combo',
  1230. fieldLabel: '单位名称',
  1231. id: 'addfm_companyCode',
  1232. name: 'company',
  1233. displayField: 'owner_name',
  1234. valueField: 'owner_id',
  1235. allowBlank: false,
  1236. blankText: "不能为空",
  1237. editable: false,
  1238. width: 330,
  1239. store: CompanyStory
  1240. }, {
  1241. fieldLabel: '详细地址',
  1242. allowBlank: false,
  1243. blankText: "不能为空",
  1244. id: 'addaddr',
  1245. name: 'addr',
  1246. hidden: true
  1247. }, {
  1248. fieldLabel: '记录编号',
  1249. id: 'addid',
  1250. name: 'id',
  1251. hidden: true
  1252. }, {
  1253. fieldLabel: '值班电话',
  1254. allowBlank: false,
  1255. blankText: "不能为空",
  1256. id: 'addphone',
  1257. name: 'phone',
  1258. xtype: 'textareafield',
  1259. maxLength: 13,
  1260. anchor: '100%'
  1261. }, {
  1262. fieldLabel: '详情地址',
  1263. allowBlank: false,
  1264. blankText: "不能为空",
  1265. id: 'addaddr',
  1266. name: 'area',
  1267. maxLength: 120,
  1268. anchor: '65%'
  1269. }, addradiogroup, addradiogroup2, {
  1270. fieldLabel: '所属区域',
  1271. id: 'addarea',
  1272. name: 'area',
  1273. maxLength: 120,
  1274. anchor: '65%'
  1275. }, {
  1276. fieldLabel: '水枪数量/只',
  1277. id: 'addbaifirehosenozzle',
  1278. allowBlank: false,
  1279. blankText: "不能为空",
  1280. name: 'baifirehosenozzle',
  1281. maxLength: 50,
  1282. anchor: '15%'
  1283. }, {
  1284. fieldLabel: '水带/条',
  1285. id: 'addfirehose',
  1286. allowBlank: false,
  1287. blankText: "不能为空",
  1288. name: 'firehose',
  1289. maxLength: 50,
  1290. anchor: '15%'
  1291. }, {
  1292. fieldLabel: '灭火器/个',
  1293. allowBlank: false,
  1294. blankText: "不能为空",
  1295. id: 'addabc',
  1296. name: 'abc',
  1297. maxLength: 50,
  1298. anchor: '15%'
  1299. }, {
  1300. fieldLabel: '防护服/件',
  1301. allowBlank: false,
  1302. blankText: "不能为空",
  1303. id: 'addturnouts',
  1304. name: 'turnouts',
  1305. maxLength: 50,
  1306. anchor: '15%'
  1307. }, {
  1308. fieldLabel: '消防头盔/个',
  1309. allowBlank: false,
  1310. blankText: "不能为空",
  1311. id: 'addfirehat',
  1312. name: 'firehat',
  1313. maxLength: 50,
  1314. anchor: '15%'
  1315. }, {
  1316. fieldLabel: '消防靴/双',
  1317. id: 'addfirefightersboots',
  1318. allowBlank: false,
  1319. blankText: "不能为空",
  1320. name: 'firefightersboots',
  1321. maxLength: 50,
  1322. anchor: '15%'
  1323. }, {
  1324. fieldLabel: '消防车/辆',
  1325. id: 'addfirecar',
  1326. name: 'firecar',
  1327. maxLength: 50,
  1328. anchor: '15%'
  1329. }, {
  1330. fieldLabel: '破拆工具/套',
  1331. id: 'addentrytool',
  1332. allowBlank: false,
  1333. blankText: "不能为空",
  1334. name: 'entrytool',
  1335. maxLength: 50,
  1336. anchor: '15%'
  1337. }, {
  1338. fieldLabel: '辖区支队',
  1339. id: 'addzd',
  1340. name: 'zd',
  1341. maxLength: 50,
  1342. anchor: '50%'
  1343. }, {
  1344. fieldLabel: '辖区大队',
  1345. id: 'adddd',
  1346. name: 'dd',
  1347. maxLength: 50,
  1348. anchor: '50%'
  1349. }, {
  1350. fieldLabel: '辖区中队',
  1351. id: 'addzz',
  1352. name: 'zz',
  1353. maxLength: 50,
  1354. anchor: '50%'
  1355. }, {
  1356. fieldLabel: '站长',
  1357. id: 'addstationMaster',
  1358. name: 'stationMaster',
  1359. maxLength: 50,
  1360. anchor: '25%'
  1361. }, {
  1362. fieldLabel: '站长电话',
  1363. id: 'addstationMasterPhoen',
  1364. name: 'stationMasterPhoen',
  1365. anchor: '50%'
  1366. },
  1367. {
  1368. id: 'addfm_queryJson',
  1369. name: 'queryJson',
  1370. hidden: true
  1371. }],
  1372. buttons: [{
  1373. text: '提交',
  1374. id: 'addconfirmBtn',
  1375. iconCls: 'ok_btn',
  1376. handler: function () {
  1377. var form = this.up('form').getForm();
  1378. if (form.isValid()) {
  1379. var queryJson = new Object();
  1380. queryJson.V_LOGINNAME = V_LOGINNAME;
  1381. queryJson.V_PASSWORD = V_PASSWORD;
  1382. queryJson.id = Ext.getCmp('addid').getValue();
  1383. // queryJson.company = Ext.getCmp('addcompany').getValue();
  1384. queryJson.addr = Ext.getCmp('addaddr').getValue();
  1385. queryJson.status = Ext.getCmp('addstationStatus').getChecked()[0].boxLabel == '启用' ? 1 : 0;
  1386. queryJson.type = Ext.getCmp('addstationType').getChecked()[0].boxLabel == '重点' ? 1 : 0;
  1387. queryJson.firehose = Ext.getCmp('addfirehose').getValue();
  1388. //===============================================================
  1389. queryJson.phone = Ext.getCmp('addphone').getValue();
  1390. queryJson.fireSataionName = Ext.getCmp('addfireSataionName').getValue();
  1391. queryJson.companyCode = Ext.getCmp('addfm_companyCode').getValue();
  1392. // queryJson.type = Ext.getCmp('type').getValue();
  1393. queryJson.area = Ext.getCmp('addarea').getValue();
  1394. queryJson.baifirehosenozzle = Ext.getCmp('addbaifirehosenozzle').getValue();
  1395. queryJson.abc = Ext.getCmp('addabc').getValue();
  1396. queryJson.turnouts = Ext.getCmp('addturnouts').getValue();
  1397. queryJson.firefightersboots = Ext.getCmp('addfirefightersboots').getValue();
  1398. queryJson.entrytool = Ext.getCmp('addentrytool').getValue();
  1399. queryJson.firecar = Ext.getCmp('addfirecar').getValue();
  1400. queryJson.firehat = Ext.getCmp('addfirehat').getValue();
  1401. queryJson.zd = Ext.getCmp('addzd').getValue();
  1402. queryJson.dd = Ext.getCmp('adddd').getValue();
  1403. queryJson.zz = Ext.getCmp('addzz').getValue();
  1404. queryJson.stationMaster = Ext.getCmp('addstationMaster').getValue();
  1405. queryJson.stationMasterPhoen = Ext.getCmp('addstationMasterPhoen').getValue();
  1406. // queryJson.insertTime = Ext.getCmp('addinsertTime').getValue();
  1407. //==========================================================
  1408. var jsonstr = Ext.JSON.encode(queryJson);
  1409. Ext.getCmp('addfm_queryJson').setValue(jsonstr);
  1410. form.submit({
  1411. method: 'post',
  1412. success: function (form, action) {
  1413. Ext.Msg.alert('操作成功', '已确认1条记录', function (btn, txt) {
  1414. clear_add_form();
  1415. myStore.reload();
  1416. // getCurrentData();
  1417. });
  1418. },
  1419. failure: function (form, action) {
  1420. Ext.Msg.alert('操作失败', action.Msg, function (btn, txt) {
  1421. clear_add_form();
  1422. myStore.reload();
  1423. //
  1424. });
  1425. }
  1426. });
  1427. this.up('window').close();
  1428. }
  1429. }
  1430. }, {
  1431. text: '关闭',
  1432. iconCls: 'cancel_btn',
  1433. handler: function () {
  1434. this.up('window').close();
  1435. }
  1436. }]
  1437. });
  1438. //===============================================
  1439. var showFireInfoWin = function (record) {
  1440. $("#VInfoWin_Title").html(record.get('data'));
  1441. Ext.getCmp('fireSataionName').setValue(record.get('fireSataionName'));
  1442. Ext.getCmp('id').setValue(record.get('id'));
  1443. Ext.getCmp('company').setValue(record.get('company'));
  1444. Ext.getCmp('fm_companyCode').setValue(record.get('companyCode'));
  1445. // var wia = Ext.getCmp('companyCode').getValue();
  1446. // alert(wia);
  1447. Ext.getCmp('addr').setValue(record.get('addr'));
  1448. Ext.getCmp('phone').setValue(record.get('phone'));
  1449. Ext.getCmp('area').setValue(record.get('area'));
  1450. Ext.getCmp('baifirehosenozzle').setValue(record.get('baifirehosenozzle'));
  1451. Ext.getCmp('firehose').setValue(record.get('firehose'));
  1452. Ext.getCmp('abc').setValue(record.get('abc'));
  1453. Ext.getCmp('turnouts').setValue(record.get('turnouts'));
  1454. Ext.getCmp('firehat').setValue(record.get('firehat'));
  1455. Ext.getCmp('firefightersboots').setValue(record.get('firefightersboots'));
  1456. Ext.getCmp('entrytool').setValue(record.get('entrytool'));
  1457. Ext.getCmp('firecar').setValue(record.get('firecar'));
  1458. Ext.getCmp('zd').setValue(record.get('zd'));
  1459. Ext.getCmp('dd').setValue(record.get('dd'));
  1460. Ext.getCmp('zz').setValue(record.get('zz'));
  1461. Ext.getCmp('stationMaster').setValue(record.get('stationMaster'));
  1462. Ext.getCmp('stationMasterPhoen').setValue(record.get('stationMasterPhoen'));
  1463. Ext.getCmp('insertTime').setValue(record.get('insertTime'));
  1464. vFileInfoWin.show();
  1465. // Ext.getCmp('uf_status').setValue(record.get('status')=='1'?'启用':'未启用');
  1466. // Ext.getCmp('uf_status').setValue(record.get('status'));
  1467. if (record.get('type') == 1) {
  1468. // checked:true
  1469. Ext.getCmp('stationType').items.get(0).setValue(true);
  1470. } else {
  1471. Ext.getCmp('stationType').items.get(1).setValue(true);
  1472. }
  1473. if (record.get('status') == 1) {
  1474. // checked:true
  1475. Ext.getCmp('stationStatus').items.get(0).setValue(true);
  1476. } else {
  1477. Ext.getCmp('stationStatus').items.get(1).setValue(true);
  1478. }
  1479. }
  1480. var detailWin = function () {
  1481. Ext.create('Ext.window.Window', {
  1482. title: '微型消防站器材详情',
  1483. height: 405,
  1484. width: 945,
  1485. layout: 'fit',
  1486. items: fireStationInfoForm,
  1487. closable: false,
  1488. modal: true,
  1489. closeAction: 'hide'
  1490. }).show();
  1491. //CompanyStory.reload();
  1492. }
  1493. Ext.grid.PageRowNumberer = Ext.extend(Ext.grid.RowNumberer, {
  1494. width: 50,
  1495. text: '序号',
  1496. renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
  1497. if (store.lastOptions.params != null) {
  1498. var pageindex = store.lastOptions.params.start;
  1499. return pageindex + rowIndex + 1;
  1500. } else {
  1501. return rowIndex + 1;
  1502. }
  1503. }
  1504. });
  1505. //数据列表
  1506. var FireOptionPanel = Ext.create('Ext.grid.Panel', {
  1507. // title: '数据测试',
  1508. header: {
  1509. height: 0,
  1510. border: '0px solid #000000'
  1511. },
  1512. titleCollapse: true,
  1513. id: 'FireStationOptionListPanel',
  1514. region: 'center',
  1515. store: myStore,
  1516. enableColumnResize:true,
  1517. //selModel: sm,
  1518. columns: [
  1519. new Ext.grid.PageRowNumberer(),
  1520. // {header: '序号', dataIndex: 'id', width: '5%', menuDisabled: true, align: 'center', hidden: false,},
  1521. {header: 'id', dataIndex: 'id', hidden: true, menuDisabled: true},
  1522. {header: '微型消防站名称', dataIndex: 'fireSataionName', width: '24%', menuDisabled: true, align: 'center'},
  1523. {header: '所属单位', dataIndex: 'company', width: '24%', menuDisabled: true, align: 'center'},
  1524. {header: '地址', dataIndex: 'addr', width: '23%', menuDisabled: true, align: 'center'},
  1525. {header: '站长', dataIndex: 'stationMaster', width: '14%', menuDisabled: true, align: 'center'},
  1526. {header: '站长电话', dataIndex: 'stationMasterPhoen', width: '15%', menuDisabled: true, align: 'center'},
  1527. /*{ text: '操作',align: 'center',
  1528. renderer: function(val,meta,rec) {
  1529. // 为元素生成唯一id
  1530. // alert(rec);
  1531. var ids =rec.data.id;
  1532. var id = Ext.id();
  1533. // console.log(ids);
  1534. Ext.defer(function() {
  1535. // var ids1 =ids;
  1536. Ext.widget('button', {
  1537. renderTo: id,
  1538. text: '查看详情',
  1539. scale: 'small',
  1540. handler: function() {
  1541. console.log(rec);
  1542. detailWin();
  1543. }
  1544. });
  1545. }, 50);
  1546. return Ext.String.format('<div id="{0}"></div>', id);
  1547. }
  1548. }*/
  1549. ],
  1550. columnLines: true,
  1551. height: maxHeight,
  1552. width: '100%',
  1553. tbar: new Ext.create('Ext.toolbar.Toolbar', {
  1554. items: [{
  1555. html: '<span id="FirePiePanel_title_string" style="color:#ffffff;background-color:rgba(0,0,0,0)">电气火警报告列表</span>'
  1556. }, '->', {
  1557. xtype: 'button',
  1558. iconCls: 'back_btn',
  1559. text: '<span style="color:#ffffff;background-color:rgba(0,0,0,0)">返回</span>',
  1560. listeners: {
  1561. click: function () {
  1562. location.href = baseUrl + 'view/frontpage/map.jsp?&theme=' + theme + '&company_code=' + company_code;
  1563. }
  1564. }
  1565. }, '-',
  1566. {
  1567. xtype: 'button',
  1568. iconCls: 'filter_btn',
  1569. text: '<span style="color:#ffffff;background-color:rgba(0,0,0,0)">筛选</span>',
  1570. listeners: {
  1571. click: filterwin
  1572. }
  1573. }, '-',
  1574. {
  1575. xtype: 'button',
  1576. iconCls: 'append_btn',
  1577. text: '<span style="color:#ffffff;background-color:rgba(0,0,0,0)">新增</span>',
  1578. listeners: {
  1579. click: addwin
  1580. }
  1581. }]
  1582. }),
  1583. bbar: new Ext.PagingToolbar({
  1584. store: myStore,
  1585. id: 'FireStationListPageToolbar',
  1586. displayInfo: true,
  1587. pageSize: countPerPage,
  1588. prependButtons: true,
  1589. displayMsg: '显示第 {0}条到 {1}条记录,总共 {2}条',
  1590. emptyMsg: "没有记录",
  1591. firstText: '第一页',
  1592. prevText: '前一页',
  1593. nextText: '后一页',
  1594. lastText: '最后一页',
  1595. refreshText: '刷新'
  1596. }),
  1597. frame: true,
  1598. border: false,
  1599. iconCls: 'icon-grid',
  1600. listeners: {
  1601. 'celldblclick': function (grid, td, cellIndex, record, tr, rowIndex, e, eOpts) {
  1602. showFireInfoWin(record);
  1603. }
  1604. }
  1605. });
  1606. new Ext.create('Ext.panel.Panel', {
  1607. width: '100%',
  1608. id: 'FireAlarmPanel',
  1609. layout: 'border',
  1610. items:
  1611. FireOptionPanel,
  1612. renderTo: Ext.getBody()
  1613. });
  1614. myStore.reload();
  1615. // getCurrentData();
  1616. $(window).resize(function () {
  1617. body_resize();
  1618. });
  1619. body_resize();
  1620. });