inspectors.js 53 KB

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