inspectors.js 53 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635
  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 = false;
  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. }
  1067. changeon1 = function(obj){
  1068. var selected = sm1.getSelection();
  1069. var id = selected[0].raw.id
  1070. var xid = obj.value;
  1071. var query = new Object();
  1072. if(xid.length>0){
  1073. query.xid = xid;
  1074. }
  1075. query.id = id;
  1076. // query.V_LOGINNAME = V_LOGINNAME;
  1077. // query.V_PASSWORD = V_PASSWORD;
  1078. var jsonstr = Ext.JSON.encode(query);
  1079. myStore1.getProxy().extraParams = {
  1080. queryJson : jsonstr
  1081. };
  1082. Ext.getCmp('InspectorsListPageToolbar3').moveFirst();
  1083. }
  1084. // var childPanel2 = function() {
  1085. // var maintenancePersonHtml2 = document.getElementById('InspectorsHtml2');
  1086. // var divhiddle = document.createElement('div');
  1087. // divhiddle.id='div26_id_inspectorsPanel3';
  1088. // divhiddle.setAttribute('class','SpringHandleHtml3DivHiddle');
  1089. // maintenancePersonHtml2.appendChild(divhiddle);
  1090. // var childPanel2_title = document.createElement('div');
  1091. // childPanel2_title.setAttribute('class','maintenancePerson_title211_div');
  1092. // childPanel2_title.innerHTML='班组名称';
  1093. // maintenancePersonHtml2.appendChild(childPanel2_title);
  1094. // var childPanel2_input = document.createElement('input');
  1095. // childPanel2_input.setAttribute('class','maintenancePerson_input211_class');
  1096. // childPanel2_input.setAttribute('id','inspectors_title211_input');
  1097. // childPanel2_input.setAttribute('type','text');
  1098. // childPanel2_input.setAttribute('value','');
  1099. // maintenancePersonHtml2.appendChild(childPanel2_input);
  1100. // var childPanel2_title1 = document.createElement('div');
  1101. // childPanel2_title1.setAttribute('class','maintenancePerson_title111_div');
  1102. // childPanel2_title1.innerHTML='负责人';
  1103. // maintenancePersonHtml2.appendChild(childPanel2_title1);
  1104. // var select = document.createElement('select');
  1105. // select.setAttribute('class','maintenancePerson_input111_class');
  1106. // select.setAttribute('onchange',"changeon1(this)");
  1107. // select.setAttribute('id','inspectors_title111_input');
  1108. // maintenancePersonHtml2.appendChild(select);
  1109. // for(var i=0;i<ConfirmStore.length;i++){
  1110. // var option3 = document.createElement('option');
  1111. // option3.innerHTML=ConfirmStore[i].name;
  1112. // option3.setAttribute('value',ConfirmStore[i].rid);
  1113. // select.appendChild(option3);
  1114. // }
  1115. // var childPanel2_title2 = document.createElement('div');
  1116. // childPanel2_title2.setAttribute('class','inspectors_title11_div');
  1117. // childPanel2_title2.setAttribute('id','inspectors_title11_div');
  1118. // childPanel2_title2.setAttribute('onmouseover',"mouseon1(this)");
  1119. // childPanel2_title2.setAttribute('onmouseout',"mouseoff1(this)");
  1120. // childPanel2_title2.setAttribute('onclick',"menu_click(this)");
  1121. // maintenancePersonHtml2.appendChild(childPanel2_title2);
  1122. // var childPanel2_title3 = document.createElement('div');
  1123. // childPanel2_title3.setAttribute('class','inspectors_title21_div');
  1124. // childPanel2_title3.setAttribute('id','inspectors_title21_div');
  1125. // childPanel2_title3.setAttribute('onmouseover',"mouseon1(this)");
  1126. // childPanel2_title3.setAttribute('onmouseout',"mouseoff1(this)");
  1127. // childPanel2_title3.setAttribute('onclick',"menu_click(this)");
  1128. // maintenancePersonHtml2.appendChild(childPanel2_title3);
  1129. // }
  1130. var childPanel2 = function() {
  1131. var maintenancePersonHtml2 = document.getElementById('InspectorsHtml2');
  1132. var divhiddle = document.createElement('div');
  1133. divhiddle.id='div26_id_inspectorsPanel3';
  1134. divhiddle.setAttribute('class','SpringHandleHtml3DivHiddle');
  1135. maintenancePersonHtml2.appendChild(divhiddle);
  1136. var title = document.createElement('div');
  1137. title.setAttribute('class','MaintenancePersonTitle123');
  1138. title.innerHTML='班组列表';
  1139. maintenancePersonHtml2.appendChild(title);
  1140. var childPanel2_title2 = document.createElement('div');
  1141. childPanel2_title2.setAttribute('class','inspectors_title11_div');
  1142. childPanel2_title2.setAttribute('id','inspectors_title11_div');
  1143. childPanel2_title2.setAttribute('onmouseover',"mouseon1(this)");
  1144. childPanel2_title2.setAttribute('onmouseout',"mouseoff1(this)");
  1145. childPanel2_title2.setAttribute('onclick',"menu_click(this)");
  1146. maintenancePersonHtml2.appendChild(childPanel2_title2);
  1147. var childPanel2_title3 = document.createElement('div');
  1148. childPanel2_title3.setAttribute('class','inspectors_title21_div');
  1149. childPanel2_title3.setAttribute('id','inspectors_title21_div');
  1150. childPanel2_title3.setAttribute('onmouseover',"mouseon1(this)");
  1151. childPanel2_title3.setAttribute('onmouseout',"mouseoff1(this)");
  1152. childPanel2_title3.setAttribute('onclick',"menu_click(this)");
  1153. maintenancePersonHtml2.appendChild(childPanel2_title3);
  1154. }
  1155. var childPanel3 = function(){
  1156. var maintenancePersonHtml3 = document.getElementById('InspectorsHtml3');
  1157. var divhiddle = document.createElement('div');
  1158. divhiddle.id='div26_id_inspectorsHtml3Panel3';
  1159. divhiddle.setAttribute('class','SpringHandleHtml3DivHiddle');
  1160. maintenancePersonHtml3.appendChild(divhiddle);
  1161. var title1 = document.createElement('div');
  1162. title1.setAttribute('class','MaintenancePersonTitle123');
  1163. title1.innerHTML='班组详情';
  1164. maintenancePersonHtml3.appendChild(title1);
  1165. var childPanel2_title = document.createElement('div');
  1166. childPanel2_title.setAttribute('class','maintenancePerson_title211_div');
  1167. childPanel2_title.innerHTML='班组名称';
  1168. maintenancePersonHtml3.appendChild(childPanel2_title);
  1169. var childPanel2_input = document.createElement('input');
  1170. childPanel2_input.setAttribute('class','maintenancePerson_input211_class');
  1171. childPanel2_input.setAttribute('id','inspectors_title211_input');
  1172. childPanel2_input.setAttribute('type','text');
  1173. childPanel2_input.setAttribute('value','');
  1174. maintenancePersonHtml3.appendChild(childPanel2_input);
  1175. var childPanel2_title1 = document.createElement('div');
  1176. childPanel2_title1.setAttribute('class','maintenancePerson_title111_div');
  1177. childPanel2_title1.innerHTML='负责人';
  1178. maintenancePersonHtml3.appendChild(childPanel2_title1);
  1179. var select = document.createElement('select');
  1180. select.setAttribute('class','maintenancePerson_input111_class');
  1181. select.setAttribute('onchange',"changeon1(this)");
  1182. select.setAttribute('id','inspectors_title111_input');
  1183. maintenancePersonHtml3.appendChild(select);
  1184. for(var i=0;i<ConfirmStore.length;i++){
  1185. var option3 = document.createElement('option');
  1186. option3.innerHTML=ConfirmStore[i].name;
  1187. option3.setAttribute('value',ConfirmStore[i].rid);
  1188. select.appendChild(option3);
  1189. }
  1190. var childPanel2_title2 = document.createElement('div');
  1191. childPanel2_title2.setAttribute('class','inspectors_title31_div');
  1192. childPanel2_title2.setAttribute('id','inspectors_title31_div');
  1193. childPanel2_title2.setAttribute('onmouseover',"mouseon1(this)");
  1194. childPanel2_title2.setAttribute('onmouseout',"mouseoff1(this)");
  1195. childPanel2_title2.setAttribute('onclick',"menu_click(this)");
  1196. maintenancePersonHtml3.appendChild(childPanel2_title2);
  1197. var childPanel2_title3 = document.createElement('div');
  1198. childPanel2_title3.setAttribute('class','inspectors_title41_div');
  1199. childPanel2_title3.setAttribute('id','inspectors_title41_div');
  1200. childPanel2_title3.setAttribute('onmouseover',"mouseon1(this)");
  1201. childPanel2_title3.setAttribute('onmouseout',"mouseoff1(this)");
  1202. childPanel2_title3.setAttribute('onclick',"menu_click(this)");
  1203. maintenancePersonHtml3.appendChild(childPanel2_title3);
  1204. }
  1205. var childPanel3_fun =function(){
  1206. var query = new Object();
  1207. // query.V_LOGINNAME = $("#V_LOGINNAME").val();
  1208. $.ajax({
  1209. type:'POST',
  1210. url: baseUrl+"iot/inspectorsx/getTeamMembersList1xj",
  1211. data: {
  1212. queryJson : Ext.JSON.encode(query)
  1213. },
  1214. success: function(result){
  1215. var json = eval('(' + result + ')');
  1216. if(json.action=='getTeamMembersList1xj'){
  1217. ConfirmStore = json.RESULT;
  1218. childPanel3();
  1219. }
  1220. }
  1221. });
  1222. }
  1223. var childPanel6 = Ext.create('Ext.Panel', {
  1224. height:maxHeight,
  1225. width:'20%',
  1226. html: '<div></div>'
  1227. });
  1228. // var childPanel2_fun =function(){
  1229. // var query = new Object();
  1230. // query.V_LOGINNAME = $("#V_LOGINNAME").val();
  1231. // $.ajax({
  1232. // type:'POST',
  1233. // url: baseUrl+"iot/inspectorsx/getTeamMembersList1xj",
  1234. // data: {
  1235. // queryJson : Ext.JSON.encode(query)
  1236. // },
  1237. // success: function(result){
  1238. // var json = eval('(' + result + ')');
  1239. // if(json.action=='getTeamMembersList1xj'){
  1240. // ConfirmStore = json.RESULT;
  1241. // childPanel2();
  1242. // }
  1243. // }
  1244. // });
  1245. // }
  1246. // var childPanel3 = Ext.create('Ext.Panel', {
  1247. // height:40,
  1248. // width:'100%',
  1249. // 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>'
  1250. // });
  1251. var MaintenancePersonPanel = Ext.create('Ext.grid.Panel', {
  1252. header :{
  1253. height:0,
  1254. border:'0px solid #000000'
  1255. },
  1256. id: 'InspectorsListPanel',
  1257. store: myStore,
  1258. selModel: sm,
  1259. columns: [
  1260. { header: 'ID', dataIndex: 'id',hidden:true, menuDisabled:true },
  1261. { header: '职能ID', dataIndex: 'zn',hidden:true, menuDisabled:true },
  1262. { header: '序号', dataIndex: 'xh', width:39, menuDisabled:true },
  1263. { header: '姓名', dataIndex: 'name', width:466,align:'center', menuDisabled:true },
  1264. { header: '手机号', dataIndex: 'phone', width:466,align:'center', menuDisabled:true },
  1265. { header: '职务', dataIndex: 'zn_name', width:466,align:'center', menuDisabled:true },
  1266. ],
  1267. columnLines: true,
  1268. height: maxHeight,
  1269. width: '100%',
  1270. bbar: new Ext.PagingToolbar({
  1271. store: myStore,
  1272. id:'InspectorsListPageToolbar',
  1273. displayInfo: true,
  1274. pageSize: countPerPage,
  1275. prependButtons: true,
  1276. displayMsg : '显示第 {0}条到 {1}条记录,总共 {2}条',
  1277. emptyMsg : "没有记录",
  1278. firstText: '第一页',
  1279. prevText: '前一页',
  1280. nextText: '后一页',
  1281. lastText: '最后一页',
  1282. refreshText: '刷新',
  1283. }),
  1284. frame: true,
  1285. border:false,
  1286. iconCls: 'icon-grid'
  1287. });
  1288. var MaintenancePersonPanel2 = Ext.create('Ext.grid.Panel', {
  1289. header :{
  1290. height:0,
  1291. border:'0px solid #000000'
  1292. },
  1293. bodyStyle:'background:#121E34;',
  1294. id: 'InspectorsListPanel2',
  1295. store: myStore2,
  1296. region:'center',
  1297. selModel: sm1,
  1298. columns: [
  1299. { header: 'ID', dataIndex: 'id',hidden:true, menuDisabled:true },
  1300. { header: '责任人ID', dataIndex: 'person_liable_id',hidden:true, menuDisabled:true },
  1301. { header: '序号', dataIndex: 'xh', width:35, menuDisabled:true },
  1302. { header: '班组名称', dataIndex: 'team_name', width:340,align:'center', menuDisabled:true },
  1303. ],
  1304. columnLines: true,
  1305. height: maxHeight,
  1306. width: '30%',
  1307. listeners: {
  1308. select: function(dataview,record,index) {//record被选中时产生的事件
  1309. var label = record.get('team_name');
  1310. var label1 = record.get('id');
  1311. var label2 = record.get('person_liable_id');
  1312. var query = new Object();
  1313. if(label1.length>0){
  1314. query.id = label1;
  1315. }
  1316. // query.V_LOGINNAME = V_LOGINNAME;
  1317. // query.V_PASSWORD = V_PASSWORD;
  1318. var jsonstr = Ext.JSON.encode(query);
  1319. myStore1.getProxy().extraParams = {
  1320. queryJson : jsonstr
  1321. };
  1322. Ext.getCmp('InspectorsListPageToolbar3').moveFirst();
  1323. document.getElementById('inspectors_title211_input').value = label;
  1324. document.getElementById('inspectors_title111_input').value = label2;
  1325. // Ext.MessageBox.alert("标题触发了"+label);
  1326. }
  1327. // itemdblclick: function () {
  1328. // Ext.MessageBox.alert("标题离开了");
  1329. // }
  1330. },
  1331. bbar: new Ext.PagingToolbar({
  1332. store: myStore2,
  1333. id:'InspectorsListPageToolbar2',
  1334. // displayInfo: true,
  1335. // pageSize: countPerPage,
  1336. // prependButtons: true,
  1337. // displayMsg : '显示第 {0}条到 {1}条记录,总共 {2}条',
  1338. // emptyMsg : "没有记录",
  1339. // firstText: '第一页',
  1340. // prevText: '前一页',
  1341. // nextText: '后一页',
  1342. // lastText: '最后一页',
  1343. // refreshText: '刷新',
  1344. }),
  1345. // frame: true,
  1346. border:false,
  1347. iconCls: 'icon-grid'
  1348. });
  1349. var MaintenancePersonPanel3 =
  1350. Ext.create('Ext.grid.Panel', {
  1351. header :{
  1352. height:0,
  1353. border:'0px solid #000000'
  1354. },
  1355. id: 'InspectorsListPanel3',
  1356. store: myStore1,
  1357. region:'center',
  1358. selModel: addsm,
  1359. columns: [
  1360. { header: 'ID', dataIndex: 'rid',hidden:true, menuDisabled:true },
  1361. { header: '责任人ID', dataIndex: 'person_liable_id',hidden:true, menuDisabled:true},
  1362. { header: '班组ID', dataIndex: 'tdid',hidden:true, menuDisabled:true},
  1363. { header: '默认值', dataIndex: 'pd',hidden:true, menuDisabled:true},
  1364. { header: '序号', dataIndex: 'xh', width:35, menuDisabled:true },
  1365. { header: '组员', dataIndex: 'name', width:633,align:'center', menuDisabled:true },
  1366. // { header: '', dataIndex: 'zrr', width:267,align:'center', menuDisabled:true },
  1367. ],
  1368. columnLines: true,
  1369. height: maxHeight,
  1370. width: '50%',
  1371. listeners:{
  1372. viewready:function(){
  1373. var hd_checker = this.getEl().select('div.x-grid3-hd-checker');
  1374. // if (hd_checker.hasClass('x-grid3-hd-checker')) {
  1375. // hd_checker.removeClass('x-grid3-hd-checker'); // 去掉全选框
  1376. // }
  1377. }
  1378. },
  1379. bbar: new Ext.PagingToolbar({
  1380. store: myStore1,
  1381. id:'InspectorsListPageToolbar3',
  1382. displayInfo: true,
  1383. pageSize: countPerPage,
  1384. prependButtons: true,
  1385. displayMsg : '显示第 {0}条到 {1}条记录,总共 {2}条',
  1386. emptyMsg : "没有记录",
  1387. firstText: '第一页',
  1388. prevText: '前一页',
  1389. nextText: '后一页',
  1390. lastText: '最后一页',
  1391. refreshText: '刷新',
  1392. }),
  1393. border:false,
  1394. iconCls: 'icon-grid'
  1395. });
  1396. var piebar = Ext.create('Ext.panel.Panel',{
  1397. id:'InspectorsHtml',
  1398. width:'100%',
  1399. height:188,
  1400. region:'north',
  1401. layout:'form',
  1402. defaults:{
  1403. border:false
  1404. }
  1405. // items: [childPanel1]
  1406. });
  1407. var piebar2 = Ext.create('Ext.panel.Panel',{
  1408. id:'InspectorsHtml2',
  1409. width:'30%',
  1410. height:140,
  1411. bodyStyle:'background:#121E34;',
  1412. region:'north',
  1413. layout:'form',
  1414. defaults:{
  1415. border:false
  1416. }
  1417. // items: [childPanel2]
  1418. });
  1419. var piebar3 = Ext.create('Ext.panel.Panel',{
  1420. id:'InspectorsHtml3',
  1421. width:'50%',
  1422. height:140,
  1423. region:'north',
  1424. layout:'form',
  1425. defaults:{
  1426. border:false
  1427. },
  1428. // items: [childPanel3]
  1429. });
  1430. panel1 = Ext.create('Ext.panel.Panel',{
  1431. width:'100%',
  1432. id: 'InspectorsPiebar',
  1433. layout:'border',
  1434. items:[
  1435. piebar,MaintenancePersonPanel
  1436. ],
  1437. });
  1438. var piebar4 = Ext.create('Ext.panel.Panel',{
  1439. id:'InspectorsHtml4',
  1440. width:'30%',
  1441. region:'west',
  1442. layout:'border',
  1443. bodyStyle:'background:#121E34;border-radius:20px;padding:10px;',
  1444. padding:10,
  1445. items:[
  1446. piebar2,MaintenancePersonPanel2
  1447. ]
  1448. });
  1449. var piebar5 = Ext.create('Ext.panel.Panel',{
  1450. id:'InspectorsHtml5',
  1451. width:'50%',
  1452. region:'center',
  1453. layout:'border',
  1454. bodyStyle:'padding:10px;',
  1455. padding:10,
  1456. items:[
  1457. piebar3,MaintenancePersonPanel3
  1458. ]
  1459. });
  1460. var piebar6 = Ext.create('Ext.panel.Panel',{
  1461. id:'InspectorsHtml6',
  1462. width:'20%',
  1463. region:'east',
  1464. layout:'form',
  1465. defaults:{
  1466. border:false
  1467. },
  1468. items: [childPanel6]
  1469. });
  1470. panel2 = Ext.create('Ext.panel.Panel',{
  1471. width:'100%',
  1472. id: 'InspectorsPiebar2',
  1473. layout:'border',
  1474. items:[
  1475. piebar4,piebar5,piebar6
  1476. ],
  1477. });
  1478. // panel2 = Ext.create('Ext.panel.Panel',{
  1479. // width:'100%',
  1480. // id: 'InspectorsPiebar2',
  1481. // layout:'border',
  1482. // items:[
  1483. // piebar2,MaintenancePersonPanel2,MaintenancePersonPanel3,piebar3
  1484. // ],
  1485. //
  1486. // });
  1487. Ext.create('Ext.tab.Panel', {
  1488. width: '100%',
  1489. id: 'InspectorsTab',
  1490. activeTab: 0,
  1491. items: [
  1492. {
  1493. itemId:'person',
  1494. title: '人员列表',
  1495. items : [panel1]
  1496. },
  1497. {
  1498. itemId:'team',
  1499. title: '班组详情',
  1500. items : [panel2]
  1501. }
  1502. ],
  1503. listeners:{
  1504. 'tabchange':function (t, n) {
  1505. var item = n.itemId;
  1506. if(item=='team'){
  1507. if(document.getElementById('div26_id_inspectorsPanel3')==undefined)
  1508. childPanel2();
  1509. if(document.getElementById('div26_id_inspectorsHtml3Panel3')==undefined)
  1510. childPanel3_fun();
  1511. myStore2.reload();
  1512. }
  1513. }
  1514. },
  1515. renderTo : Ext.getBody()
  1516. });
  1517. myStore.reload();
  1518. mystore2_fun(0);
  1519. childPanel1();
  1520. $(window).resize(function(){
  1521. body_resize();
  1522. body_resize1();
  1523. });
  1524. body_resize1();
  1525. body_resize();
  1526. });