inspectors.js 53 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649
  1. /**
  2. * inspectors.js
  3. * 巡检人管理界面
  4. * emial: yaoqiang@chinausky.com
  5. * create: 2018-12-08
  6. */
  7. Ext.Loader.setConfig({
  8. enabled: true
  9. });
  10. Ext.Loader.setPath('Ext.ux', '../../res/extjs/examples/ux');
  11. Ext.require([
  12. 'Ext.grid.*',
  13. 'Ext.data.*',
  14. 'Ext.ux.RowExpander',
  15. 'Ext.selection.CheckboxModel'
  16. ]);
  17. var company_code;
  18. var myStore=null;
  19. var myStore1=null;
  20. var myStore2=null;
  21. var V_LOGINNAME='',V_PASSWORD='';
  22. var menuidx = '';
  23. var mouseon;
  24. var mouseoff;
  25. var mouseon1;
  26. var mouseoff1;
  27. var menu_click;
  28. var panel1;
  29. var panel2;
  30. var changeon1;
  31. var sm = Ext.create('Ext.selection.CheckboxModel');
  32. var addsm = Ext.create('Ext.selection.CheckboxModel',{
  33. handleMouseDown : Ext.emptyFn,
  34. singleSelect : false
  35. });
  36. var sm1 = Ext.create('Ext.selection.CheckboxModel',{
  37. injectCheckbox:1,//checkbox位于哪一列,默认值为0
  38. mode:'single',//multi,simple,single;默认为多选multi
  39. // checkOnly:true,//如果值为true,则只用点击checkbox列才能选中此条记录
  40. allowDeselect:true,//如果值true,并且mode值为单选(single)时,可以通过点击checkbox取消对其的选择
  41. enableKeyNav:false,
  42. listeners: {
  43. deselect: function(model,record,index) {//取消选中时产生的事件
  44. }
  45. }
  46. });
  47. Ext.define('MaintenancePerson',{
  48. extend: 'Ext.data.Model',
  49. fields: [
  50. {name:'id', type:'string'},
  51. {name:'name', type:'string'},
  52. {name:'phone', type:'string'},
  53. {name:'zn_name', type:'string'},
  54. {name:'xh', type:'int'},
  55. ]
  56. });
  57. Ext.define('MaintenancePerson1',{
  58. extend: 'Ext.data.Model',
  59. fields: [
  60. {name:'rid', type:'int'},
  61. {name:'xh', type:'int'},
  62. {name:'name', type:'string'},
  63. {name:'tdid', type:'string'},
  64. {name:'pd', type:'int'},
  65. // {name:'zrr', type:'string'},
  66. ]
  67. });
  68. Ext.define('MaintenancePerson2',{
  69. extend: 'Ext.data.Model',
  70. fields: [
  71. {name:'id', type:'string'},
  72. {name:'xh', type:'int'},
  73. {name:'team_name', type:'string'},
  74. {name:'person_liable_id', type:'string'},
  75. ]
  76. });
  77. function exportbtn_click(){
  78. baseUrl = document.getElementById('basePath').value;
  79. V_LOGINNAME = $("#V_LOGINNAME").val();
  80. V_PASSWORD = $("#V_PASSWORD").val();
  81. name = document.getElementById('name').value;
  82. zn = document.getElementById('zn').value;
  83. // zn_name = document.getElementById('zn_name').value;
  84. var fields = '';
  85. var array = ['id','xh','name','phone','zn_name'];
  86. var excelname = ['ID','序号','姓名','手机号','职务'];
  87. for(var i=0;i<5;i++){
  88. if(i>0)
  89. fields += ',';
  90. fields += '{id:"'+array[i]+'",title:"'+excelname[i]+'",shown:"'+true+'"}';
  91. }
  92. var query = new Object();
  93. // query.V_LOGINNAME = V_LOGINNAME;
  94. // query.V_PASSWORD = V_PASSWORD;
  95. query.name = name;
  96. query.zn = zn;
  97. query.EXPORT_FILE = '维保人列表';
  98. query.fields = '['+fields+']';
  99. $.ajax({
  100. type:'POST',
  101. url: baseUrl+"iot/excel/view/XjInspectorsExcel",
  102. data: {
  103. queryJson : Ext.JSON.encode(query)
  104. },
  105. success: function(result){
  106. var json = eval('(' + result + ')');
  107. if(json.action=='dormExport'){
  108. ConfirmStore = json.RESULT;
  109. var elemIF = document.createElement("iframe");
  110. elemIF.src = baseUrl+json.filename;
  111. elemIF.style.display = "none";
  112. document.body.appendChild(elemIF);
  113. }
  114. }
  115. });
  116. }
  117. var body_resize = function(){
  118. maxHeight = document.documentElement.clientHeight;
  119. maxHeight-=34;
  120. maxWidth = document.documentElement.clientWidth;
  121. Ext.getCmp('InspectorsPiebar').setHeight(maxHeight);
  122. Ext.getCmp('InspectorsPiebar').setWidth(maxWidth);
  123. }
  124. var body_resize1 = function(){
  125. maxHeight = document.documentElement.clientHeight;
  126. maxHeight-=34;
  127. maxWidth = document.documentElement.clientWidth;
  128. Ext.getCmp('InspectorsPiebar2').setHeight(maxHeight);
  129. Ext.getCmp('InspectorsPiebar2').setWidth(maxWidth);
  130. }
  131. Ext.onReady(function(){
  132. var baseUrl = document.getElementById('basePath').value;
  133. var theme = document.getElementById('theme').value;
  134. var chkIcon = '<img src="'+baseUrl+'res/img/common/check.gif"/>'
  135. var unchkIcon = '<img src="'+baseUrl+'res/img/common/uncheck.gif"/>'
  136. $("#V_LOGINNAME").val(sessionStorage.getItem('V_LOGINNAME'));
  137. $("#V_PASSWORD").val(sessionStorage.getItem('V_PASSWORD'));
  138. V_LOGINNAME = $("#V_LOGINNAME").val();
  139. V_PASSWORD = $("#V_PASSWORD").val();
  140. var countPerPage = 15;
  141. var maxHeight = 10000;
  142. var chkBoolean = function(flag) {
  143. if(flag)
  144. return chkIcon;
  145. return unchkIcon;
  146. }
  147. var queryJson = new Object();
  148. queryJson.V_LOGINNAME = V_LOGINNAME;
  149. // queryJson.V_PASSWORD = V_PASSWORD;
  150. // queryJson.COMMSTATUS = 'NO';
  151. if((company_code!=null)&&(company_code!='null')&&(company_code.length>0))
  152. queryJson.company_code = company_code;
  153. var clear_append_form1 = function (){
  154. Ext.getCmp('fa_Inspectors_team_name').setValue("");
  155. Ext.getCmp('fa_Inspectors_person_liable_id').setValue("");
  156. Ext.getCmp('InspectorsListPageToolbar2').moveFirst();
  157. }
  158. myStore = Ext.create('Ext.data.Store', {
  159. model: 'MaintenancePerson',
  160. pageSize: countPerPage,
  161. proxy: {
  162. type: 'ajax',
  163. actionMethods: {
  164. create : 'POST',
  165. read : 'POST', // by default GET
  166. update : 'POST',
  167. destroy: 'POST'
  168. },
  169. url: baseUrl+'iot/inspectorsx/getList',
  170. reader: {
  171. type: 'json',
  172. root: 'RESULT',
  173. totalProperty: 'totalCount'
  174. },
  175. extraParams:{
  176. queryJson:Ext.JSON.encode(queryJson)
  177. }
  178. },
  179. remoteSort: true
  180. });
  181. myStore2 = Ext.create('Ext.data.Store', {
  182. model: 'MaintenancePerson2',
  183. pageSize: countPerPage,
  184. proxy: {
  185. type: 'ajax',
  186. actionMethods: {
  187. create : 'POST',
  188. read : 'POST', // by default GET
  189. update : 'POST',
  190. destroy: 'POST'
  191. },
  192. url: baseUrl+'iot/planteam/getList1',
  193. reader: {
  194. type: 'json',
  195. root: 'RESULT',
  196. totalProperty: 'totalCount'
  197. },
  198. extraParams:{
  199. queryJson:Ext.JSON.encode(queryJson)
  200. }
  201. },
  202. remoteSort: true
  203. });
  204. var mystore2_fun = function(id){
  205. if(id== 0){
  206. myStore2.on('load',function(myStore2, record){
  207. for (var i = 0; i < record.length; i++) {
  208. var records = record[i];
  209. if (records.get('xh') == 1) {
  210. Ext.getCmp('InspectorsListPanel2').getSelectionModel().select(records, true);
  211. }
  212. };
  213. });
  214. }else{
  215. myStore2.reload();
  216. myStore2.on('load',function(myStore2, record){
  217. for (var i = 0; i < record.length; i++) {
  218. var records = record[i];
  219. if (records.get('id') == id) {
  220. Ext.getCmp('InspectorsListPanel2').getSelectionModel().select(records, true);
  221. }
  222. };
  223. });
  224. }
  225. }
  226. myStore1 = Ext.create('Ext.data.Store', {
  227. model: 'MaintenancePerson1',
  228. pageSize: countPerPage,
  229. proxy: {
  230. type: 'ajax',
  231. actionMethods: {
  232. create : 'POST',
  233. read : 'POST', // by default GET
  234. update : 'POST',
  235. destroy: 'POST'
  236. },
  237. url: baseUrl+'iot/inspectorsx/getTeamMembersListxj',
  238. reader: {
  239. type: 'json',
  240. root: 'RESULT',
  241. totalProperty: 'totalCount'
  242. },
  243. extraParams:{
  244. queryJson:Ext.JSON.encode(queryJson)
  245. }
  246. },
  247. remoteSort: true
  248. });
  249. myStore1.on('load',function(myStore1, record){
  250. for (var i = 0; i < record.length; i++) {
  251. var records = record[i];
  252. if (records.get('pd') == 1) {
  253. Ext.getCmp('InspectorsListPanel3').getSelectionModel().select(records, true);
  254. }
  255. };
  256. });
  257. Ext.define('getJobDutiesStore1',{
  258. extend:'Ext.data.Model',
  259. fields: [
  260. {name:'name', type:'string'},
  261. {name:'rid',type:'int'}
  262. ]
  263. });
  264. var getJobDutiesStore1 = Ext.create('Ext.data.Store',{
  265. model: 'getJobDutiesStore1',
  266. proxy: {
  267. type: 'ajax',
  268. actionMethods: {
  269. create : 'POST',
  270. read : 'POST', // by default GET
  271. update : 'POST',
  272. destroy: 'POST'
  273. },
  274. url: baseUrl+'iot/inspectorsx/getTeamMembersList1xj',
  275. reader: {
  276. type: 'json',
  277. root: 'RESULT',
  278. totalProperty: 'totalCount'
  279. },
  280. extraParams:{
  281. queryJson:Ext.JSON.encode(queryJson)
  282. }
  283. }
  284. });
  285. var AppendForm = Ext.create('Ext.form.Panel', {
  286. id: 'InspectorsAppendForm',
  287. labelWidth: 55,
  288. url: baseUrl+'iot/inspectorsx/append',
  289. defaultType: 'textfield',
  290. bodyPadding: 15,
  291. items: [{
  292. fieldLabel:'人员姓名',
  293. id: 'fa_Inspectors_name',
  294. name:'name',
  295. maxLength:20,
  296. maxLengthText:'长度不得超出{0}',
  297. anchor:'75%',
  298. listeners: {
  299. select: function(o,e){
  300. console.log(o,e)
  301. // value.replace(/^1(?:3\d|4[4-9]|5[0-35-9]|6[67]|7[013-8]|8\d|9\d)\d{8}$/,'')
  302. }
  303. }
  304. },{
  305. fieldLabel:'电话号码',
  306. id: 'fa_Inspectors_phone',
  307. name: 'phone',
  308. maxLength: 250,
  309. maxLengthText:'长度不得超出{0}',
  310. anchor:'75%'
  311. },{
  312. xtype: 'checkboxgroup',
  313. fieldLabel: '人员职能',
  314. id:"fa_Inspectors_inspectiontime",
  315. columns: 3,
  316. items: [
  317. {boxLabel: '维保', name: 'maintenance',inputValue:"1"},
  318. {boxLabel: '巡检', name: 'inspection',inputValue:"2"},
  319. {boxLabel: '报修', name: 'event_processing',inputValue:"4"}
  320. ]},{
  321. id:'fa_Inspectors_queryJson',
  322. name:'queryJson',
  323. hidden:true
  324. }],
  325. buttons: [{
  326. text: '提交',
  327. iconCls:'ok_btn',
  328. handler: function() {
  329. var form = this.up('form').getForm();
  330. if (form.isValid()) {
  331. var InspectiontimeValue = Ext.getCmp('fa_Inspectors_inspectiontime').getChecked();
  332. var Inspectiontime=0;
  333. Ext.Array.each(InspectiontimeValue, function(item){
  334. Inspectiontime +=parseInt(item.inputValue);
  335. });
  336. var query = new Object();
  337. // query.V_LOGINNAME = V_LOGINNAME;
  338. query.zn=Inspectiontime;
  339. query.name = Ext.getCmp('fa_Inspectors_name').getValue();
  340. query.phone = Ext.getCmp('fa_Inspectors_phone').getValue();
  341. var jsonstr = Ext.JSON.encode(query);
  342. Ext.getCmp('fa_Inspectors_queryJson').setValue(jsonstr);
  343. form.submit({
  344. method:'post',
  345. success: function(form, action) {
  346. Ext.Msg.alert('操作成功', '已保存', function(btn,txt){
  347. Ext.getCmp('InspectorsAppendForm').getForm().reset();
  348. Ext.getCmp('InspectorsListPageToolbar').moveFirst();
  349. });
  350. },
  351. failure: function(form, action) {
  352. Ext.Msg.alert('操作失败', action.Msg , function(btn,txt){
  353. });
  354. }
  355. });
  356. }
  357. }
  358. },{
  359. text: '关闭',
  360. iconCls: 'cancel_btn',
  361. handler: function() {
  362. this.up('window').hide();
  363. }
  364. }]
  365. });
  366. var appendwin = function(){
  367. Ext.create('Ext.window.Window', {
  368. title: '新增',
  369. height: 350,
  370. width: 400,
  371. modal: true,
  372. layout: 'fit',
  373. items: AppendForm,
  374. closeAction: 'hide'
  375. }).show();
  376. }
  377. var AppendForm1 = Ext.create('Ext.form.Panel', {
  378. id: 'InspectorsAppendForm1',
  379. labelWidth: 55,
  380. url: baseUrl+'iot/planteam/append1',
  381. defaultType: 'textfield',
  382. bodyPadding: 15,
  383. items: [{
  384. fieldLabel:'班组名称',
  385. id: 'fa_Inspectors_team_name',
  386. name:'team_name',
  387. maxLength:20,
  388. maxLengthText:'长度不得超出{0}',
  389. anchor:'75%'
  390. },{
  391. fieldLabel:'负责人',
  392. id: 'fa_Inspectors_person_liable_id',
  393. name:'person_liable_id',
  394. xtype:'combo',
  395. store:getJobDutiesStore1,
  396. displayField : 'name',
  397. valueField : 'rid',
  398. editable : false,
  399. anchor:'75%'
  400. },{
  401. id:'fa_Inspectors_queryJson1',
  402. name:'queryJson',
  403. hidden:true
  404. }],
  405. buttons: [{
  406. text: '提交',
  407. iconCls:'ok_btn',
  408. handler: function() {
  409. var form = this.up('form').getForm();
  410. if (form.isValid()) {
  411. var query = new Object();
  412. // query.V_LOGINNAME = $("#V_LOGINNAME").val();
  413. query.team_name = Ext.getCmp('fa_Inspectors_team_name').getValue();
  414. query.person_liable_id = Ext.getCmp('fa_Inspectors_person_liable_id').getValue();
  415. var jsonstr = Ext.JSON.encode(query);
  416. Ext.getCmp('fa_Inspectors_queryJson1').setValue(jsonstr);
  417. form.submit({
  418. method:'post',
  419. success: function(form, action) {
  420. Ext.Msg.alert('操作成功', '已保存', function(btn,txt){
  421. clear_append_form1();
  422. });
  423. },
  424. failure: function(form, action) {
  425. Ext.Msg.alert('操作失败', action.Msg , function(btn,txt){
  426. clear_append_form1();
  427. });
  428. }
  429. });
  430. }
  431. }
  432. },{
  433. text: '关闭',
  434. iconCls: 'cancel_btn',
  435. handler: function() {
  436. this.up('window').hide();
  437. }
  438. }]
  439. });
  440. var appendwin1 = function(){
  441. Ext.create('Ext.window.Window', {
  442. title: '新增',
  443. height: 350,
  444. width: 400,
  445. modal: true,
  446. layout: 'fit',
  447. items: AppendForm1,
  448. closeAction: 'hide'
  449. }).show();
  450. }
  451. var clear_modify_form = function (){
  452. Ext.getCmp('fm_inspectors_id').setValue("");
  453. Ext.getCmp('fm_inspectors_queryJson').setValue("");
  454. Ext.getCmp('fm_inspectors_name').setValue("");
  455. Ext.getCmp('fm_inspectors_phone').setValue("");
  456. Ext.getCmp('fm_inspectors_inspectiontime').setValue(false);
  457. Ext.getCmp('InspectorsListPanel').getStore().reload();
  458. }
  459. var ModifyForm = Ext.create('Ext.form.Panel', {
  460. id: 'InspectorsEditForm',
  461. labelWidth: 55,
  462. url: baseUrl+'iot/inspectorsx/update',
  463. defaultType: 'textfield',
  464. bodyPadding: 15,
  465. items: [{
  466. fieldLabel:'人员姓名',
  467. id: 'fm_inspectors_name',
  468. name:'name',
  469. maxLength:20,
  470. maxLengthText:'长度不得超出{0}',
  471. anchor:'75%',
  472. listeners: {
  473. select: function(o,e){
  474. console.log(o,e)
  475. // value.replace(/^1(?:3\d|4[4-9]|5[0-35-9]|6[67]|7[013-8]|8\d|9\d)\d{8}$/,'')
  476. }
  477. }
  478. },{
  479. fieldLabel:'电话号码',
  480. id: 'fm_inspectors_phone',
  481. name: 'phone',
  482. maxLength: 250,
  483. maxLengthText:'长度不得超出{0}',
  484. anchor:'75%'
  485. },{
  486. xtype: 'checkboxgroup',
  487. fieldLabel: '人员职能',
  488. id:"fm_inspectors_inspectiontime",
  489. columns: 3,
  490. items: [
  491. {boxLabel: '维保', name: 'maintenance',inputValue:"1",id:'inspectors_maintenance'},
  492. {boxLabel: '巡检', name: 'inspection',inputValue:"2",id:'inspectors_inspection'},
  493. {boxLabel: '报修', name: 'event_processing',inputValue:"4",id:'inspectors_event_processing'}
  494. ]},{
  495. id: 'fm_inspectors_id',
  496. name:'id',
  497. hidden:true
  498. },{
  499. id:'fm_inspectors_queryJson',
  500. name:'queryJson',
  501. hidden:true
  502. }],
  503. buttons: [{
  504. text: '修改',
  505. iconCls:'ok_btn',
  506. handler: function() {
  507. var form = this.up('form').getForm();
  508. if (form.isValid()) {
  509. var InspectiontimeValue = Ext.getCmp('fm_inspectors_inspectiontime').getChecked();
  510. var Inspectiontime=0;
  511. Ext.Array.each(InspectiontimeValue, function(item){
  512. Inspectiontime +=parseInt(item.inputValue);
  513. });
  514. var query = new Object();
  515. query.zn=Inspectiontime;
  516. query.id = Ext.getCmp('fm_inspectors_id').getValue();
  517. query.name = Ext.getCmp('fm_inspectors_name').getValue();
  518. query.phone = Ext.getCmp('fm_inspectors_phone').getValue();
  519. var jsonstr = Ext.JSON.encode(query);
  520. Ext.getCmp('fm_inspectors_queryJson').setValue(jsonstr);
  521. form.submit({
  522. method:'post',
  523. success: function(form, action) {
  524. Ext.Msg.alert('操作成功', '已修改', function(btn,txt){
  525. clear_modify_form();
  526. });
  527. },
  528. failure: function(form, action) {
  529. Ext.Msg.alert('操作失败', action.Msg , function(btn,txt){
  530. clear_modify_form();
  531. });
  532. }
  533. });
  534. this.up('window').hide();
  535. }
  536. }
  537. },{
  538. text: '关闭',
  539. iconCls: 'cancel_btn',
  540. handler: function() {
  541. this.up('window').hide();
  542. clear_modify_form();
  543. }
  544. }]
  545. });
  546. var modifywin = function(){
  547. Ext.create('Ext.window.Window', {
  548. title: '修改',
  549. height: 350,
  550. width: 400,
  551. modal: true,
  552. layout: 'fit',
  553. items: ModifyForm,
  554. closeAction: 'hide'
  555. }).show();
  556. }
  557. var chk_sm = function() {
  558. if(sm.getCount()==1){
  559. modifywin();
  560. var selected = sm.getSelection();
  561. var fm_inspectiontime = selected[0].raw.zn
  562. if(fm_inspectiontime=='1'){
  563. var domainArr = ['1'];
  564. }else if(fm_inspectiontime=='2'){
  565. var domainArr = ['2'];
  566. }else if(fm_inspectiontime=='3'){
  567. var domainArr = ['1','2'];
  568. }else if(fm_inspectiontime=='4'){
  569. var domainArr = ['4'];
  570. }else if(fm_inspectiontime=='5'){
  571. var domainArr = ['1','4'];
  572. }else if(fm_inspectiontime=='6'){
  573. var domainArr = ['2','4'];
  574. }else if(fm_inspectiontime=='7'){
  575. var domainArr = ['1','2','4'];
  576. }
  577. for(var i = 0 ;i < domainArr.length;i++) {
  578. switch(domainArr[i]) {
  579. case "1":
  580. Ext.getCmp('inspectors_maintenance').setValue(true);
  581. break;
  582. case "2":
  583. Ext.getCmp('inspectors_inspection').setValue(true);
  584. break;
  585. case "4":
  586. Ext.getCmp('inspectors_event_processing').setValue(true);
  587. break;
  588. }
  589. }
  590. Ext.getCmp('fm_inspectors_id').setValue(selected[0].raw.id);
  591. Ext.getCmp('fm_inspectors_name').setValue(selected[0].raw.name);
  592. Ext.getCmp('fm_inspectors_phone').setValue(selected[0].raw.phone);
  593. }else{
  594. Ext.Msg.alert('请先选择','请先选择一条记录,再点击修改');
  595. }
  596. }
  597. var del_sm = function() {
  598. if(sm.getCount()==1){
  599. var selected = sm.getSelection( );
  600. var query = new Object();
  601. var list = new Array();
  602. var o = new Object();
  603. o.id = selected[0].raw.id;
  604. list.push(o);
  605. query.ID_LIST = list;
  606. var jsonstr= Ext.JSON.encode(query);
  607. Ext.MessageBox.confirm('删除人员信息','是否删除'+selected[0].raw.name+' 维保人员?',function(btn){
  608. if(btn=='yes'){
  609. $.ajax({
  610. type:'POST',
  611. url: baseUrl+"iot/inspectorsx/del",
  612. data: {
  613. queryJson : jsonstr
  614. },
  615. success: function(result){
  616. var json = eval('(' + result + ')');
  617. if(json.action=='deleteInspectors'){
  618. if(json.success==true){
  619. Ext.Msg.alert('操作成功', json.MSG , function(btn,txt){
  620. Ext.getCmp('InspectorsListPanel').getStore().reload();
  621. });
  622. }else{
  623. Ext.Msg.alert('操作失败', json.MSG , function(btn,txt){
  624. Ext.getCmp('InspectorsListPanel').getStore().reload();
  625. });
  626. }
  627. }
  628. }
  629. });
  630. }
  631. },this);
  632. }else{
  633. if(sm.getCount()>1){
  634. var query = new Object();
  635. var list = new Array();
  636. for(var i=0;i<sm.getCount();i++){
  637. var selected = sm.getSelection( );
  638. var o = new Object();
  639. o.id = selected[i].raw.id;
  640. list.push(o);
  641. }
  642. query.ID_LIST = list;
  643. var jsonstr= Ext.JSON.encode(query);
  644. Ext.MessageBox.confirm('删除人员信息','是否删除选中的'+sm.getCount()+' 个维保人员?',function(btn){
  645. if(btn=='yes'){
  646. $.ajax({
  647. type:'POST',
  648. url: baseUrl+"iot/inspectorsx/del",
  649. data: {
  650. queryJson : jsonstr
  651. },
  652. success: function(result){
  653. var json = eval('(' + result + ')');
  654. if(json.action=='deleteInspectors'){
  655. if(json.success==true){
  656. Ext.Msg.alert('操作成功', json.MSG , function(btn,txt){
  657. Ext.getCmp('InspectorsListPanel').getStore().reload();
  658. });
  659. }else{
  660. Ext.Msg.alert('操作失败', json.MSG , function(btn,txt){
  661. Ext.getCmp('InspectorsListPanel').getStore().reload();
  662. });
  663. }
  664. }
  665. }
  666. });
  667. }
  668. },this);
  669. }else{
  670. Ext.Msg.alert('请先选择','至少选择一条记录,再点击删除');
  671. }
  672. }
  673. }
  674. var del_sm1 = function() {
  675. if(sm1.getCount()==1){
  676. var selected = sm1.getSelection( );
  677. var query = new Object();
  678. var list = new Array();
  679. var o = new Object();
  680. o.id = selected[0].raw.id;
  681. list.push(o);
  682. query.ID_LIST = list;
  683. var jsonstr= Ext.JSON.encode(query);
  684. Ext.MessageBox.confirm('删除班组','是否删除'+selected[0].raw.name+' 班组?',function(btn){
  685. if(btn=='yes'){
  686. $.ajax({
  687. type:'POST',
  688. url: baseUrl+"iot/planteam/del",
  689. data: {
  690. queryJson : jsonstr
  691. },
  692. success: function(result){
  693. var json = eval('(' + result + ')');
  694. if(json.action=='deletePlanTeam'){
  695. if(json.success==true){
  696. Ext.Msg.alert('操作成功', json.MSG , function(btn,txt){
  697. Ext.getCmp('InspectorsListPanel2').getStore().reload();
  698. });
  699. }else{
  700. Ext.Msg.alert('操作失败', json.MSG , function(btn,txt){
  701. Ext.getCmp('InspectorsListPanel2').getStore().reload();
  702. });
  703. }
  704. }
  705. }
  706. });
  707. }
  708. },this);
  709. }else{
  710. if(sm1.getCount()>1){
  711. var query = new Object();
  712. var list = new Array();
  713. for(var i=0;i<sm.getCount();i++){
  714. var selected = sm1.getSelection( );
  715. var o = new Object();
  716. o.id = selected[i].raw.id;
  717. list.push(o);
  718. }
  719. query.ID_LIST = list;
  720. var jsonstr= Ext.JSON.encode(query);
  721. Ext.MessageBox.confirm('删除班组','是否删除选中的'+sm1.getCount()+' 个班组?',function(btn){
  722. if(btn=='yes'){
  723. $.ajax({
  724. type:'POST',
  725. url: baseUrl+"iot/planteam/del",
  726. data: {
  727. queryJson : jsonstr
  728. },
  729. success: function(result){
  730. var json = eval('(' + result + ')');
  731. if(json.action=='deletePlanTeam'){
  732. if(json.success==true){
  733. Ext.Msg.alert('操作成功', json.MSG , function(btn,txt){
  734. Ext.getCmp('InspectorsListPanel2').getStore().reload();
  735. });
  736. }else{
  737. Ext.Msg.alert('操作失败', json.MSG , function(btn,txt){
  738. Ext.getCmp('InspectorsListPanel2').getStore().reload();
  739. });
  740. }
  741. }
  742. }
  743. });
  744. }
  745. },this);
  746. }else{
  747. Ext.Msg.alert('请先选择','至少选择一条记录,再点击删除');
  748. }
  749. }
  750. }
  751. var show_page = function(){
  752. var arr = 0;
  753. var r = document.getElementsByName("zhineng");
  754. if(r.length>1){
  755. for(var i = 0; i < r.length; i++) {
  756. if(r[i].checked) {
  757. arr+=parseInt(r[i].value);
  758. }
  759. }
  760. }else if(r.length==1){
  761. arr = parseInt(r[0].value);
  762. }else{
  763. arr = 0;
  764. }
  765. var maintenancePerson_title3_input = document.getElementById('inspectors_title3_input1').value;
  766. var query = new Object();
  767. if(arr > 0){
  768. query.zn = arr;
  769. $("#zn").val(arr);
  770. }
  771. if(maintenancePerson_title3_input.length>0){
  772. query.name = maintenancePerson_title3_input;
  773. $("#name").val(maintenancePerson_title3_input);
  774. }
  775. // query.V_LOGINNAME = V_LOGINNAME;
  776. // query.V_PASSWORD = V_PASSWORD;
  777. var jsonstr = Ext.JSON.encode(query);
  778. myStore.getProxy().extraParams = {
  779. queryJson : jsonstr
  780. };
  781. Ext.getCmp('InspectorsListPageToolbar').moveFirst();
  782. }
  783. var show_page1 = function(){
  784. var maintenancePerson_title21_input = document.getElementById('maintenancePerson_title21_input').value;
  785. var maintenancePerson_title31_input = document.getElementById('maintenancePerson_title31_input1').value;
  786. var query = new Object();
  787. if(maintenancePerson_title21_input.length>0){
  788. query.spot_name = maintenancePerson_title21_input;
  789. }
  790. if(maintenancePerson_title31_input.length>0){
  791. query.name = maintenancePerson_title31_input;
  792. }
  793. // query.V_LOGINNAME = V_LOGINNAME;
  794. // query.V_PASSWORD = V_PASSWORD;
  795. var jsonstr = Ext.JSON.encode(query);
  796. myStore.getProxy().extraParams = {
  797. queryJson : jsonstr
  798. };
  799. Ext.getCmp('InspectorsListPageToolbar2').moveFirst();
  800. }
  801. var reset1 = function(){
  802. var zn = document.getElementsByName("zhineng");
  803. for (var i = 0; i < zn.length; i++) {
  804. zn[i].checked = true;
  805. }
  806. document.getElementById('inspectors_title3_input1').value = '';
  807. $("#zn").val('');
  808. $("#name").val('');
  809. show_page();
  810. }
  811. var reset11 = function(){
  812. document.getElementById('maintenancePerson_title21_input').value = '';
  813. document.getElementById('maintenancePerson_title31_input1').value = '';
  814. }
  815. mouseon = function(obj){
  816. var id = obj.id;
  817. $("#"+id).removeClass(id);
  818. $("#"+id).addClass(id+'_on');
  819. }
  820. mouseon1 = function(obj){
  821. var id = obj.id;
  822. $("#"+id).removeClass(id);
  823. $("#"+id).addClass(id+'_on');
  824. }
  825. mouseoff = function(obj){
  826. var mid = "inspectors_";
  827. for(var i=1;i<7;i++){
  828. var id = "inspectors_title"+i+"_div";
  829. $("#"+id).removeClass(id+'_on');
  830. $("#"+id).addClass(id);
  831. }
  832. if(menuidx=='m1'){
  833. mid += 'title1_div';
  834. $("#"+mid).removeClass(mid);
  835. $("#"+mid).addClass(mid+'_on');
  836. }
  837. else if(menuidx=='m2'){
  838. mid += 'title2_div';
  839. $("#"+mid).removeClass(mid);
  840. $("#"+mid).addClass(mid+'_on');
  841. }
  842. else if(menuidx=='m3'){
  843. mid += 'title3_div';
  844. $("#"+mid).removeClass(mid);
  845. $("#"+mid).addClass(mid+'_on');
  846. }
  847. else if(menuidx=='m4'){
  848. mid += 'title4_div';
  849. $("#"+mid).removeClass(mid);
  850. $("#"+mid).addClass(mid+'_on');
  851. }
  852. else if(menuidx=='m5'){
  853. mid += 'title5_div';
  854. $("#"+mid).removeClass(mid);
  855. $("#"+mid).addClass(mid+'_on');
  856. }
  857. else if(menuidx=='m6'){
  858. mid += 'title6_div';
  859. $("#"+mid).removeClass(mid);
  860. $("#"+mid).addClass(mid+'_on');
  861. }
  862. }
  863. mouseoff1 = function(obj){
  864. var mid = "inspectors_";
  865. for(var i=1;i<5;i++){
  866. var id = "inspectors_title"+i+"1_div";
  867. $("#"+id).removeClass(id+'_on');
  868. $("#"+id).addClass(id);
  869. }
  870. if(menuidx=='m11'){
  871. mid += 'title11_div';
  872. $("#"+mid).removeClass(mid);
  873. $("#"+mid).addClass(mid+'_on');
  874. }
  875. else if(menuidx=='m21'){
  876. mid += 'title21_div';
  877. $("#"+mid).removeClass(mid);
  878. $("#"+mid).addClass(mid+'_on');
  879. }
  880. else if(menuidx=='m31'){
  881. mid += 'title31_div';
  882. $("#"+mid).removeClass(mid);
  883. $("#"+mid).addClass(mid+'_on');
  884. }
  885. else if(menuidx=='m41'){
  886. mid += 'title41_div';
  887. $("#"+mid).removeClass(mid);
  888. $("#"+mid).addClass(mid+'_on');
  889. }
  890. }
  891. menu_click = function(obj){
  892. var id = obj.id;
  893. if(id=='inspectors_title1_div'){
  894. menuidx = 'm1';
  895. show_page();
  896. }
  897. else if(id=='inspectors_title2_div'){
  898. menuidx = 'm2';
  899. reset1();
  900. }
  901. else if(id=='inspectors_title3_div'){
  902. menuidx = 'm3';
  903. exportbtn_click();
  904. }
  905. else if(id=='inspectors_title4_div'){
  906. menuidx = 'm4';
  907. del_sm();
  908. }
  909. else if(id=='inspectors_title5_div'){
  910. menuidx = 'm5';
  911. appendwin();
  912. }
  913. else if(id=='inspectors_title6_div'){
  914. menuidx = 'm6';
  915. chk_sm();
  916. }
  917. else if(id=='inspectors_title11_div'){
  918. menuidx = 'm11';
  919. del_sm1();
  920. }
  921. else if(id=='inspectors_title21_div'){
  922. menuidx = 'm21';
  923. appendwin1();
  924. }
  925. else if(id=='inspectors_title31_div'){
  926. menuidx = 'm31';
  927. Preservation_panel3();
  928. }
  929. else if(id=='inspectors_title41_div'){
  930. menuidx = 'm41';
  931. cancel_panel3();
  932. }
  933. }
  934. var Preservation_panel3 = function(){
  935. var team_name = document.getElementById('inspectors_title211_input').value;
  936. var person_liable_id = document.getElementById('inspectors_title111_input').value;
  937. var selected = sm1.getSelection( );
  938. var selected1 = addsm.getSelection( );
  939. var tid=selected1[0].raw.tdid;
  940. for(var i=0;i<addsm.getCount();i++){
  941. if(i==0)
  942. people_id_list = selected1[i].raw.rid;
  943. else
  944. people_id_list += ","+selected1[i].raw.rid;
  945. }
  946. var query = new Object();
  947. query.team_name=team_name;
  948. query.person_liable_id =person_liable_id ;
  949. query.tid = tid ;
  950. query.people_id_list = people_id_list ;
  951. $.ajax({
  952. type:'POST',
  953. url: baseUrl+"iot/planteam/update",
  954. data: {
  955. queryJson : Ext.JSON.encode(query)
  956. },
  957. success: function(result){
  958. Ext.Msg.alert('操作成功', '已修改', function(btn,txt){
  959. mystore2_fun(tid);
  960. // cancel_panel3();
  961. });
  962. },
  963. failure : function() {
  964. Ext.Msg.alert('操作失败', function(btn,txt){
  965. cancel_panel3();
  966. });
  967. }
  968. });
  969. }
  970. var cancel_panel3 = function() {
  971. var selected = sm1.getSelection( );
  972. var stor1_id=selected[0].raw.id;
  973. var label1 = selected[0].raw.team_name;
  974. var label2 = selected[0].raw.person_liable_id;
  975. var query = new Object();
  976. query.id = stor1_id;
  977. // query.V_LOGINNAME = V_LOGINNAME;
  978. // query.V_PASSWORD = V_PASSWORD;
  979. var jsonstr = Ext.JSON.encode(query);
  980. myStore1.getProxy().extraParams = {
  981. queryJson : jsonstr
  982. };
  983. Ext.getCmp('InspectorsListPageToolbar3').moveFirst();
  984. document.getElementById('inspectors_title211_input').value = label1;
  985. document.getElementById('inspectors_title111_input').value = label2;
  986. }
  987. var childPanel1 = function() {
  988. var maintenancePersonHtml = document.getElementById('InspectorsHtml');
  989. var childPanel1_title = document.createElement('div');
  990. childPanel1_title.setAttribute('class','maintenanceperson_title2_div');
  991. childPanel1_title.innerHTML='职能';
  992. maintenancePersonHtml.appendChild(childPanel1_title);
  993. var childPanel1_input1 = document.createElement('input');
  994. childPanel1_input1.setAttribute('class','input4_class');
  995. // childPanel1_input1.setAttribute('id','maintenancePerson_title3_input1');
  996. childPanel1_input1.setAttribute('type','checkbox');
  997. childPanel1_input1.setAttribute('name','zhineng');
  998. childPanel1_input1.setAttribute('value','1');
  999. maintenancePersonHtml.appendChild(childPanel1_input1);
  1000. var childPanel1_div = document.createElement('div');
  1001. childPanel1_div.setAttribute('class','childPanel1_div');
  1002. childPanel1_div.innerHTML='维保';
  1003. maintenancePersonHtml.appendChild(childPanel1_div);
  1004. var childPanel1_input2 = document.createElement('input');
  1005. childPanel1_input2.setAttribute('class','input2_class');
  1006. // childPanel1_input1.setAttribute('id','maintenancePerson_title3_input1');
  1007. childPanel1_input2.setAttribute('type','checkbox');
  1008. childPanel1_input2.setAttribute('name','zhineng');
  1009. childPanel1_input2.setAttribute('value','2');
  1010. maintenancePersonHtml.appendChild(childPanel1_input2);
  1011. var childPanel1_div1 = document.createElement('div');
  1012. childPanel1_div1.setAttribute('class','childPanel1_div1');
  1013. childPanel1_div1.innerHTML='巡检';
  1014. maintenancePersonHtml.appendChild(childPanel1_div1);
  1015. var childPanel1_input3 = document.createElement('input');
  1016. childPanel1_input3.setAttribute('class','input3_class')
  1017. // childPanel1_input1.setAttribute('id','maintenancePerson_title3_input1');
  1018. childPanel1_input3.setAttribute('type','checkbox');
  1019. childPanel1_input3.setAttribute('name','zhineng');
  1020. childPanel1_input3.setAttribute('value','4');
  1021. maintenancePersonHtml.appendChild(childPanel1_input3);
  1022. var childPanel1_div2 = document.createElement('div');
  1023. childPanel1_div2.setAttribute('class','childPanel1_div2');
  1024. childPanel1_div2.innerHTML='报修';
  1025. maintenancePersonHtml.appendChild(childPanel1_div2);
  1026. var childPanel1_title1 = document.createElement('div');
  1027. childPanel1_title1.setAttribute('class','title3_div');
  1028. childPanel1_title1.innerHTML='姓名';
  1029. maintenancePersonHtml.appendChild(childPanel1_title1);
  1030. var childPanel1_input = document.createElement('input');
  1031. childPanel1_input.setAttribute('class','input1_class');
  1032. childPanel1_input.setAttribute('id','inspectors_title3_input1');
  1033. childPanel1_input.setAttribute('type','text');
  1034. childPanel1_input.setAttribute('value','');
  1035. maintenancePersonHtml.appendChild(childPanel1_input);
  1036. var childPanel1_title2 = document.createElement('div');
  1037. childPanel1_title2.setAttribute('class','inspectors_title1_div');
  1038. childPanel1_title2.setAttribute('id','inspectors_title1_div');
  1039. childPanel1_title2.setAttribute('onmouseover',"mouseon(this)");
  1040. childPanel1_title2.setAttribute('onmouseout',"mouseoff(this)");
  1041. childPanel1_title2.setAttribute('onclick',"menu_click(this)");
  1042. maintenancePersonHtml.appendChild(childPanel1_title2);
  1043. var childPanel1_title3 = document.createElement('div');
  1044. childPanel1_title3.setAttribute('class','inspectors_title2_div');
  1045. childPanel1_title3.setAttribute('id','inspectors_title2_div');
  1046. childPanel1_title3.setAttribute('onmouseover',"mouseon(this)");
  1047. childPanel1_title3.setAttribute('onmouseout',"mouseoff(this)");
  1048. childPanel1_title3.setAttribute('onclick',"menu_click(this)");
  1049. maintenancePersonHtml.appendChild(childPanel1_title3);
  1050. var childPanel1_title4 = document.createElement('div');
  1051. childPanel1_title4.setAttribute('class','inspectors_title3_div');
  1052. childPanel1_title4.setAttribute('id','inspectors_title3_div');
  1053. childPanel1_title4.setAttribute('onmouseover',"mouseon(this)");
  1054. childPanel1_title4.setAttribute('onmouseout',"mouseoff(this)");
  1055. childPanel1_title4.setAttribute('onclick',"menu_click(this)");
  1056. maintenancePersonHtml.appendChild(childPanel1_title4);
  1057. var childPanel1_title5 = document.createElement('div');
  1058. childPanel1_title5.setAttribute('class','inspectors_title4_div');
  1059. childPanel1_title5.setAttribute('id','inspectors_title4_div');
  1060. childPanel1_title5.setAttribute('onmouseover',"mouseon(this)");
  1061. childPanel1_title5.setAttribute('onmouseout',"mouseoff(this)");
  1062. childPanel1_title5.setAttribute('onclick',"menu_click(this)");
  1063. maintenancePersonHtml.appendChild(childPanel1_title5);
  1064. var childPanel1_title6 = document.createElement('div');
  1065. childPanel1_title6.setAttribute('class','inspectors_title5_div');
  1066. childPanel1_title6.setAttribute('id','inspectors_title5_div');
  1067. childPanel1_title6.setAttribute('onmouseover',"mouseon(this)");
  1068. childPanel1_title6.setAttribute('onmouseout',"mouseoff(this)");
  1069. childPanel1_title6.setAttribute('onclick',"menu_click(this)");
  1070. maintenancePersonHtml.appendChild(childPanel1_title6);
  1071. var childPanel1_title7 = document.createElement('div');
  1072. childPanel1_title7.setAttribute('class','inspectors_title6_div');
  1073. childPanel1_title7.setAttribute('id','inspectors_title6_div');
  1074. childPanel1_title7.setAttribute('onmouseover',"mouseon(this)");
  1075. childPanel1_title7.setAttribute('onmouseout',"mouseoff(this)");
  1076. childPanel1_title7.setAttribute('onclick',"menu_click(this)");
  1077. maintenancePersonHtml.appendChild(childPanel1_title7);
  1078. reset1();
  1079. }
  1080. changeon1 = function(obj){
  1081. var selected = sm1.getSelection();
  1082. var id = selected[0].raw.id
  1083. var xid = obj.value;
  1084. var query = new Object();
  1085. if(xid.length>0){
  1086. query.xid = xid;
  1087. }
  1088. query.id = id;
  1089. // query.V_LOGINNAME = V_LOGINNAME;
  1090. // query.V_PASSWORD = V_PASSWORD;
  1091. var jsonstr = Ext.JSON.encode(query);
  1092. myStore1.getProxy().extraParams = {
  1093. queryJson : jsonstr
  1094. };
  1095. Ext.getCmp('InspectorsListPageToolbar3').moveFirst();
  1096. }
  1097. // var childPanel2 = function() {
  1098. // var maintenancePersonHtml2 = document.getElementById('InspectorsHtml2');
  1099. // var divhiddle = document.createElement('div');
  1100. // divhiddle.id='div26_id_inspectorsPanel3';
  1101. // divhiddle.setAttribute('class','SpringHandleHtml3DivHiddle');
  1102. // maintenancePersonHtml2.appendChild(divhiddle);
  1103. // var childPanel2_title = document.createElement('div');
  1104. // childPanel2_title.setAttribute('class','maintenancePerson_title211_div');
  1105. // childPanel2_title.innerHTML='班组名称';
  1106. // maintenancePersonHtml2.appendChild(childPanel2_title);
  1107. // var childPanel2_input = document.createElement('input');
  1108. // childPanel2_input.setAttribute('class','maintenancePerson_input211_class');
  1109. // childPanel2_input.setAttribute('id','inspectors_title211_input');
  1110. // childPanel2_input.setAttribute('type','text');
  1111. // childPanel2_input.setAttribute('value','');
  1112. // maintenancePersonHtml2.appendChild(childPanel2_input);
  1113. // var childPanel2_title1 = document.createElement('div');
  1114. // childPanel2_title1.setAttribute('class','maintenancePerson_title111_div');
  1115. // childPanel2_title1.innerHTML='负责人';
  1116. // maintenancePersonHtml2.appendChild(childPanel2_title1);
  1117. // var select = document.createElement('select');
  1118. // select.setAttribute('class','maintenancePerson_input111_class');
  1119. // select.setAttribute('onchange',"changeon1(this)");
  1120. // select.setAttribute('id','inspectors_title111_input');
  1121. // maintenancePersonHtml2.appendChild(select);
  1122. // for(var i=0;i<ConfirmStore.length;i++){
  1123. // var option3 = document.createElement('option');
  1124. // option3.innerHTML=ConfirmStore[i].name;
  1125. // option3.setAttribute('value',ConfirmStore[i].rid);
  1126. // select.appendChild(option3);
  1127. // }
  1128. // var childPanel2_title2 = document.createElement('div');
  1129. // childPanel2_title2.setAttribute('class','inspectors_title11_div');
  1130. // childPanel2_title2.setAttribute('id','inspectors_title11_div');
  1131. // childPanel2_title2.setAttribute('onmouseover',"mouseon1(this)");
  1132. // childPanel2_title2.setAttribute('onmouseout',"mouseoff1(this)");
  1133. // childPanel2_title2.setAttribute('onclick',"menu_click(this)");
  1134. // maintenancePersonHtml2.appendChild(childPanel2_title2);
  1135. // var childPanel2_title3 = document.createElement('div');
  1136. // childPanel2_title3.setAttribute('class','inspectors_title21_div');
  1137. // childPanel2_title3.setAttribute('id','inspectors_title21_div');
  1138. // childPanel2_title3.setAttribute('onmouseover',"mouseon1(this)");
  1139. // childPanel2_title3.setAttribute('onmouseout',"mouseoff1(this)");
  1140. // childPanel2_title3.setAttribute('onclick',"menu_click(this)");
  1141. // maintenancePersonHtml2.appendChild(childPanel2_title3);
  1142. // }
  1143. var childPanel2 = function() {
  1144. var maintenancePersonHtml2 = document.getElementById('InspectorsHtml2');
  1145. var divhiddle = document.createElement('div');
  1146. divhiddle.id='div26_id_inspectorsPanel3';
  1147. divhiddle.setAttribute('class','SpringHandleHtml3DivHiddle');
  1148. maintenancePersonHtml2.appendChild(divhiddle);
  1149. var title = document.createElement('div');
  1150. title.setAttribute('class','MaintenancePersonTitle123');
  1151. title.innerHTML='班组列表';
  1152. maintenancePersonHtml2.appendChild(title);
  1153. var childPanel2_title2 = document.createElement('div');
  1154. childPanel2_title2.setAttribute('class','inspectors_title11_div');
  1155. childPanel2_title2.setAttribute('id','inspectors_title11_div');
  1156. childPanel2_title2.setAttribute('onmouseover',"mouseon1(this)");
  1157. childPanel2_title2.setAttribute('onmouseout',"mouseoff1(this)");
  1158. childPanel2_title2.setAttribute('onclick',"menu_click(this)");
  1159. maintenancePersonHtml2.appendChild(childPanel2_title2);
  1160. var childPanel2_title3 = document.createElement('div');
  1161. childPanel2_title3.setAttribute('class','inspectors_title21_div');
  1162. childPanel2_title3.setAttribute('id','inspectors_title21_div');
  1163. childPanel2_title3.setAttribute('onmouseover',"mouseon1(this)");
  1164. childPanel2_title3.setAttribute('onmouseout',"mouseoff1(this)");
  1165. childPanel2_title3.setAttribute('onclick',"menu_click(this)");
  1166. maintenancePersonHtml2.appendChild(childPanel2_title3);
  1167. }
  1168. var childPanel3 = function(){
  1169. var maintenancePersonHtml3 = document.getElementById('InspectorsHtml3');
  1170. var divhiddle = document.createElement('div');
  1171. divhiddle.id='div26_id_inspectorsHtml3Panel3';
  1172. divhiddle.setAttribute('class','SpringHandleHtml3DivHiddle');
  1173. maintenancePersonHtml3.appendChild(divhiddle);
  1174. var title1 = document.createElement('div');
  1175. title1.setAttribute('class','MaintenancePersonTitle123');
  1176. title1.innerHTML='班组详情';
  1177. maintenancePersonHtml3.appendChild(title1);
  1178. var childPanel2_title = document.createElement('div');
  1179. childPanel2_title.setAttribute('class','maintenancePerson_title211_div');
  1180. childPanel2_title.innerHTML='班组名称';
  1181. maintenancePersonHtml3.appendChild(childPanel2_title);
  1182. var childPanel2_input = document.createElement('input');
  1183. childPanel2_input.setAttribute('class','maintenancePerson_input211_class');
  1184. childPanel2_input.setAttribute('id','inspectors_title211_input');
  1185. childPanel2_input.setAttribute('type','text');
  1186. childPanel2_input.setAttribute('value','');
  1187. maintenancePersonHtml3.appendChild(childPanel2_input);
  1188. var childPanel2_title1 = document.createElement('div');
  1189. childPanel2_title1.setAttribute('class','maintenancePerson_title111_div');
  1190. childPanel2_title1.innerHTML='负责人';
  1191. maintenancePersonHtml3.appendChild(childPanel2_title1);
  1192. var select = document.createElement('select');
  1193. select.setAttribute('class','maintenancePerson_input111_class');
  1194. select.setAttribute('onchange',"changeon1(this)");
  1195. select.setAttribute('id','inspectors_title111_input');
  1196. maintenancePersonHtml3.appendChild(select);
  1197. for(var i=0;i<ConfirmStore.length;i++){
  1198. var option3 = document.createElement('option');
  1199. option3.innerHTML=ConfirmStore[i].name;
  1200. option3.setAttribute('value',ConfirmStore[i].rid);
  1201. select.appendChild(option3);
  1202. }
  1203. var childPanel2_title2 = document.createElement('div');
  1204. childPanel2_title2.setAttribute('class','inspectors_title31_div');
  1205. childPanel2_title2.setAttribute('id','inspectors_title31_div');
  1206. childPanel2_title2.setAttribute('onmouseover',"mouseon1(this)");
  1207. childPanel2_title2.setAttribute('onmouseout',"mouseoff1(this)");
  1208. childPanel2_title2.setAttribute('onclick',"menu_click(this)");
  1209. maintenancePersonHtml3.appendChild(childPanel2_title2);
  1210. var childPanel2_title3 = document.createElement('div');
  1211. childPanel2_title3.setAttribute('class','inspectors_title41_div');
  1212. childPanel2_title3.setAttribute('id','inspectors_title41_div');
  1213. childPanel2_title3.setAttribute('onmouseover',"mouseon1(this)");
  1214. childPanel2_title3.setAttribute('onmouseout',"mouseoff1(this)");
  1215. childPanel2_title3.setAttribute('onclick',"menu_click(this)");
  1216. maintenancePersonHtml3.appendChild(childPanel2_title3);
  1217. }
  1218. var childPanel3_fun =function(){
  1219. var query = new Object();
  1220. query.V_LOGINNAME = $("#V_LOGINNAME").val();
  1221. $.ajax({
  1222. type:'POST',
  1223. url: baseUrl+"iot/inspectorsx/getTeamMembersList1xj",
  1224. data: {
  1225. queryJson : Ext.JSON.encode(query)
  1226. },
  1227. success: function(result){
  1228. var json = eval('(' + result + ')');
  1229. if(json.action=='getTeamMembersList1xj'){
  1230. ConfirmStore = json.RESULT;
  1231. childPanel3();
  1232. }
  1233. }
  1234. });
  1235. }
  1236. var childPanel6 = Ext.create('Ext.Panel', {
  1237. height:maxHeight,
  1238. width:'20%',
  1239. html: '<div></div>'
  1240. });
  1241. // var childPanel2_fun =function(){
  1242. // var query = new Object();
  1243. // query.V_LOGINNAME = $("#V_LOGINNAME").val();
  1244. // $.ajax({
  1245. // type:'POST',
  1246. // url: baseUrl+"iot/inspectorsx/getTeamMembersList1xj",
  1247. // data: {
  1248. // queryJson : Ext.JSON.encode(query)
  1249. // },
  1250. // success: function(result){
  1251. // var json = eval('(' + result + ')');
  1252. // if(json.action=='getTeamMembersList1xj'){
  1253. // ConfirmStore = json.RESULT;
  1254. // childPanel2();
  1255. // }
  1256. // }
  1257. // });
  1258. // }
  1259. // var childPanel3 = Ext.create('Ext.Panel', {
  1260. // height:40,
  1261. // width:'100%',
  1262. // html: '<div id="inspectors_title31_div" class="inspectors_title31_div" onmouseover="mouseon1(this);" onmouseout="mouseoff1(this);" onclick="menu_click(this);"></div><div id="inspectors_title41_div" class="inspectors_title41_div" onmouseover="mouseon1(this);" onmouseout="mouseoff1(this);" onclick="menu_click(this);"></div>'
  1263. // });
  1264. var MaintenancePersonPanel = Ext.create('Ext.grid.Panel', {
  1265. header :{
  1266. height:0,
  1267. border:'0px solid #000000'
  1268. },
  1269. id: 'InspectorsListPanel',
  1270. store: myStore,
  1271. selModel: sm,
  1272. columns: [
  1273. { header: 'ID', dataIndex: 'id',hidden:true, menuDisabled:true },
  1274. { header: '职能ID', dataIndex: 'zn',hidden:true, menuDisabled:true },
  1275. { header: '序号', dataIndex: 'xh', width:39, menuDisabled:true },
  1276. { header: '姓名', dataIndex: 'name', width:466,align:'center', menuDisabled:true },
  1277. { header: '手机号', dataIndex: 'phone', width:466,align:'center', menuDisabled:true },
  1278. { header: '职务', dataIndex: 'zn_name', width:466,align:'center', menuDisabled:true },
  1279. ],
  1280. columnLines: true,
  1281. height: maxHeight,
  1282. width: '100%',
  1283. bbar: new Ext.PagingToolbar({
  1284. store: myStore,
  1285. id:'InspectorsListPageToolbar',
  1286. displayInfo: true,
  1287. pageSize: countPerPage,
  1288. prependButtons: true,
  1289. displayMsg : '显示第 {0}条到 {1}条记录,总共 {2}条',
  1290. emptyMsg : "没有记录",
  1291. firstText: '第一页',
  1292. prevText: '前一页',
  1293. nextText: '后一页',
  1294. lastText: '最后一页',
  1295. refreshText: '刷新',
  1296. }),
  1297. frame: true,
  1298. border:false,
  1299. iconCls: 'icon-grid'
  1300. });
  1301. var MaintenancePersonPanel2 = Ext.create('Ext.grid.Panel', {
  1302. header :{
  1303. height:0,
  1304. border:'0px solid #000000'
  1305. },
  1306. bodyStyle:'background:#121E34;',
  1307. id: 'InspectorsListPanel2',
  1308. store: myStore2,
  1309. region:'center',
  1310. selModel: sm1,
  1311. columns: [
  1312. { header: 'ID', dataIndex: 'id',hidden:true, menuDisabled:true },
  1313. { header: '责任人ID', dataIndex: 'person_liable_id',hidden:true, menuDisabled:true },
  1314. { header: '序号', dataIndex: 'xh', width:35, menuDisabled:true },
  1315. { header: '班组名称', dataIndex: 'team_name', width:340,align:'center', menuDisabled:true },
  1316. ],
  1317. columnLines: true,
  1318. height: maxHeight,
  1319. width: '30%',
  1320. listeners: {
  1321. select: function(dataview,record,index) {//record被选中时产生的事件
  1322. var label = record.get('team_name');
  1323. var label1 = record.get('id');
  1324. var label2 = record.get('person_liable_id');
  1325. var query = new Object();
  1326. if(label1.length>0){
  1327. query.id = label1;
  1328. }
  1329. // query.V_LOGINNAME = V_LOGINNAME;
  1330. // query.V_PASSWORD = V_PASSWORD;
  1331. var jsonstr = Ext.JSON.encode(query);
  1332. myStore1.getProxy().extraParams = {
  1333. queryJson : jsonstr
  1334. };
  1335. Ext.getCmp('InspectorsListPageToolbar3').moveFirst();
  1336. document.getElementById('inspectors_title211_input').value = label;
  1337. document.getElementById('inspectors_title111_input').value = label2;
  1338. // Ext.MessageBox.alert("标题触发了"+label);
  1339. }
  1340. // itemdblclick: function () {
  1341. // Ext.MessageBox.alert("标题离开了");
  1342. // }
  1343. },
  1344. bbar: new Ext.PagingToolbar({
  1345. store: myStore2,
  1346. id:'InspectorsListPageToolbar2',
  1347. // displayInfo: true,
  1348. // pageSize: countPerPage,
  1349. // prependButtons: true,
  1350. // displayMsg : '显示第 {0}条到 {1}条记录,总共 {2}条',
  1351. // emptyMsg : "没有记录",
  1352. // firstText: '第一页',
  1353. // prevText: '前一页',
  1354. // nextText: '后一页',
  1355. // lastText: '最后一页',
  1356. // refreshText: '刷新',
  1357. }),
  1358. // frame: true,
  1359. border:false,
  1360. iconCls: 'icon-grid'
  1361. });
  1362. var MaintenancePersonPanel3 =
  1363. Ext.create('Ext.grid.Panel', {
  1364. header :{
  1365. height:0,
  1366. border:'0px solid #000000'
  1367. },
  1368. id: 'InspectorsListPanel3',
  1369. store: myStore1,
  1370. region:'center',
  1371. selModel: addsm,
  1372. columns: [
  1373. { header: 'ID', dataIndex: 'rid',hidden:true, menuDisabled:true },
  1374. { header: '责任人ID', dataIndex: 'person_liable_id',hidden:true, menuDisabled:true},
  1375. { header: '班组ID', dataIndex: 'tdid',hidden:true, menuDisabled:true},
  1376. { header: '默认值', dataIndex: 'pd',hidden:true, menuDisabled:true},
  1377. { header: '序号', dataIndex: 'xh', width:35, menuDisabled:true },
  1378. { header: '组员', dataIndex: 'name', width:633,align:'center', menuDisabled:true },
  1379. // { header: '', dataIndex: 'zrr', width:267,align:'center', menuDisabled:true },
  1380. ],
  1381. columnLines: true,
  1382. height: maxHeight,
  1383. width: '50%',
  1384. listeners:{
  1385. viewready:function(){
  1386. var hd_checker = this.getEl().select('div.x-grid3-hd-checker');
  1387. // if (hd_checker.hasClass('x-grid3-hd-checker')) {
  1388. // hd_checker.removeClass('x-grid3-hd-checker'); // 去掉全选框
  1389. // }
  1390. }
  1391. },
  1392. bbar: new Ext.PagingToolbar({
  1393. store: myStore1,
  1394. id:'InspectorsListPageToolbar3',
  1395. displayInfo: true,
  1396. pageSize: countPerPage,
  1397. prependButtons: true,
  1398. displayMsg : '显示第 {0}条到 {1}条记录,总共 {2}条',
  1399. emptyMsg : "没有记录",
  1400. firstText: '第一页',
  1401. prevText: '前一页',
  1402. nextText: '后一页',
  1403. lastText: '最后一页',
  1404. refreshText: '刷新',
  1405. }),
  1406. border:false,
  1407. iconCls: 'icon-grid'
  1408. });
  1409. var piebar = Ext.create('Ext.panel.Panel',{
  1410. id:'InspectorsHtml',
  1411. width:'100%',
  1412. height:188,
  1413. region:'north',
  1414. layout:'form',
  1415. defaults:{
  1416. border:false
  1417. }
  1418. // items: [childPanel1]
  1419. });
  1420. var piebar2 = Ext.create('Ext.panel.Panel',{
  1421. id:'InspectorsHtml2',
  1422. width:'30%',
  1423. height:140,
  1424. bodyStyle:'background:#121E34;',
  1425. region:'north',
  1426. layout:'form',
  1427. defaults:{
  1428. border:false
  1429. }
  1430. // items: [childPanel2]
  1431. });
  1432. var piebar3 = Ext.create('Ext.panel.Panel',{
  1433. id:'InspectorsHtml3',
  1434. width:'50%',
  1435. height:140,
  1436. region:'north',
  1437. layout:'form',
  1438. defaults:{
  1439. border:false
  1440. },
  1441. // items: [childPanel3]
  1442. });
  1443. panel1 = Ext.create('Ext.panel.Panel',{
  1444. width:'100%',
  1445. id: 'InspectorsPiebar',
  1446. layout:'border',
  1447. items:[
  1448. piebar,MaintenancePersonPanel
  1449. ],
  1450. });
  1451. var piebar4 = Ext.create('Ext.panel.Panel',{
  1452. id:'InspectorsHtml4',
  1453. width:'30%',
  1454. region:'west',
  1455. layout:'border',
  1456. bodyStyle:'background:#121E34;border-radius:20px;padding:10px;',
  1457. padding:10,
  1458. items:[
  1459. piebar2,MaintenancePersonPanel2
  1460. ]
  1461. });
  1462. var piebar5 = Ext.create('Ext.panel.Panel',{
  1463. id:'InspectorsHtml5',
  1464. width:'50%',
  1465. region:'center',
  1466. layout:'border',
  1467. bodyStyle:'padding:10px;',
  1468. padding:10,
  1469. items:[
  1470. piebar3,MaintenancePersonPanel3
  1471. ]
  1472. });
  1473. var piebar6 = Ext.create('Ext.panel.Panel',{
  1474. id:'InspectorsHtml6',
  1475. width:'20%',
  1476. region:'east',
  1477. layout:'form',
  1478. defaults:{
  1479. border:false
  1480. },
  1481. items: [childPanel6]
  1482. });
  1483. panel2 = Ext.create('Ext.panel.Panel',{
  1484. width:'100%',
  1485. id: 'InspectorsPiebar2',
  1486. layout:'border',
  1487. items:[
  1488. piebar4,piebar5,piebar6
  1489. ],
  1490. });
  1491. // panel2 = Ext.create('Ext.panel.Panel',{
  1492. // width:'100%',
  1493. // id: 'InspectorsPiebar2',
  1494. // layout:'border',
  1495. // items:[
  1496. // piebar2,MaintenancePersonPanel2,MaintenancePersonPanel3,piebar3
  1497. // ],
  1498. //
  1499. // });
  1500. Ext.create('Ext.tab.Panel', {
  1501. width: '100%',
  1502. id: 'InspectorsTab',
  1503. activeTab: 0,
  1504. items: [
  1505. {
  1506. itemId:'person',
  1507. title: '人员列表',
  1508. items : [panel1]
  1509. },
  1510. {
  1511. itemId:'team',
  1512. title: '班组详情',
  1513. items : [panel2]
  1514. }
  1515. ],
  1516. listeners:{
  1517. 'tabchange':function (t, n) {
  1518. var item = n.itemId;
  1519. if(item=='team'){
  1520. if(document.getElementById('div26_id_inspectorsPanel3')==undefined)
  1521. childPanel2();
  1522. if(document.getElementById('div26_id_inspectorsHtml3Panel3')==undefined)
  1523. childPanel3_fun();
  1524. myStore2.reload();
  1525. }
  1526. }
  1527. },
  1528. renderTo : Ext.getBody()
  1529. });
  1530. myStore.reload();
  1531. mystore2_fun(0);
  1532. childPanel1();
  1533. $(window).resize(function(){
  1534. body_resize();
  1535. body_resize1();
  1536. });
  1537. body_resize1();
  1538. body_resize();
  1539. });