inspectors.js 51 KB

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