1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693 |
- /**
- * maintenanceperson.js
- * 维保人管理界面
- * emial: yaoqiang@chinausky.com
- * create: 2018-12-08
- */
- Ext.Loader.setConfig({
- enabled: true
- });
- Ext.Loader.setPath('Ext.ux', '../../res/extjs/examples/ux');
- Ext.require([
- 'Ext.grid.*',
- 'Ext.data.*',
- 'Ext.ux.RowExpander',
- 'Ext.selection.CheckboxModel'
- ]);
- var company_code;
- var myStore = null;
- var myStore1 = null;
- var myStore2 = null;
- var V_LOGINNAME = '', V_PASSWORD = '';
- var menuidx = '';
- var mouseon;
- var mouseoff;
- var mouseon1;
- var mouseoff1;
- var menu_click;
- var panel1;
- var panel2;
- var changeon1;
- var sm = Ext.create('Ext.selection.CheckboxModel');
- var addsm = Ext.create('Ext.selection.CheckboxModel', {
- handleMouseDown: Ext.emptyFn,
- singleSelect: false
- });
- var sm1 = Ext.create('Ext.selection.CheckboxModel', {
- injectCheckbox: 1,//checkbox位于哪一列,默认值为0
- mode: 'single',//multi,simple,single;默认为多选multi
- // checkOnly:true,//如果值为true,则只用点击checkbox列才能选中此条记录
- allowDeselect: true,//如果值true,并且mode值为单选(single)时,可以通过点击checkbox取消对其的选择
- enableKeyNav: false,
- listeners: {
- deselect: function (model, record, index) {//取消选中时产生的事件
- }
- }
- });
- Ext.define('MaintenancePerson', {
- extend: 'Ext.data.Model',
- fields: [
- { name: 'id', type: 'string' },
- { name: 'name', type: 'string' },
- { name: 'phone', type: 'string' },
- { name: 'zn_name', type: 'string' },
- { name: 'xh', type: 'int' },
- ]
- });
- Ext.define('MaintenancePerson1', {
- extend: 'Ext.data.Model',
- fields: [
- { name: 'rid', type: 'int' },
- { name: 'xh', type: 'int' },
- { name: 'name', type: 'string' },
- { name: 'tdid', type: 'string' },
- { name: 'pd', type: 'int' },
- // {name:'zrr', type:'string'},
- ]
- });
- Ext.define('MaintenancePerson2', {
- extend: 'Ext.data.Model',
- fields: [
- { name: 'id', type: 'string' },
- { name: 'xh', type: 'int' },
- { name: 'team_name', type: 'string' },
- { name: 'person_liable_id', type: 'string' },
- ]
- });
- function exportbtn_click() {
- baseUrl = document.getElementById('basePath').value;
- V_LOGINNAME = $("#V_LOGINNAME").val();
- V_PASSWORD = $("#V_PASSWORD").val();
- name = document.getElementById('name').value;
- zn = document.getElementById('zn').value;
- // zn_name = document.getElementById('zn_name').value;
- var fields = '';
- var array = ['id', 'xh', 'name', 'phone', 'zn_name'];
- var excelname = ['ID', '序号', '姓名', '手机号', '职务'];
- for (var i = 0; i < 5; i++) {
- if (i > 0)
- fields += ',';
- fields += '{id:"' + array[i] + '",title:"' + excelname[i] + '",shown:"' + true + '"}';
- }
- var query = new Object();
- // query.V_LOGINNAME = V_LOGINNAME;
- // query.V_PASSWORD = V_PASSWORD;
- query.name = name;
- query.zn = zn;
- query.EXPORT_FILE = '维保人列表';
- query.fields = '[' + fields + ']';
- $.ajax({
- type: 'POST',
- url: baseUrl + "iot/excel/view/XjInspectorsExcel",
- data: {
- queryJson: Ext.JSON.encode(query)
- },
- success: function (result) {
- var json = eval('(' + result + ')');
- if (json.action == 'dormExport') {
- ConfirmStore = json.RESULT;
- var elemIF = document.createElement("iframe");
- elemIF.src = baseUrl + json.filename;
- elemIF.style.display = "none";
- document.body.appendChild(elemIF);
- }
- }
- });
- }
- var body_resize = function () {
- maxHeight = document.documentElement.clientHeight;
- maxHeight -= 34;
- maxWidth = document.documentElement.clientWidth;
- Ext.getCmp('MaintenancePersonPiebar').setHeight(maxHeight);
- Ext.getCmp('MaintenancePersonPiebar').setWidth(maxWidth);
- }
- var body_resize1 = function () {
- maxHeight = document.documentElement.clientHeight;
- maxHeight -= 34;
- maxWidth = document.documentElement.clientWidth;
- Ext.getCmp('MaintenancePersonPiebar2').setHeight(maxHeight);
- Ext.getCmp('MaintenancePersonPiebar2').setWidth(maxWidth);
- }
- //var body_resize0 = function(){
- // maxHeight1 = document.documentElement.clientHeight;
- // Ext.getCmp('MaintenancePersonTab').setHeight(maxHeight1);
- //}
- Ext.onReady(function () {
- var baseUrl = document.getElementById('basePath').value;
- var theme = document.getElementById('theme').value;
- var chkIcon = '<img src="' + baseUrl + 'res/img/common/check.gif"/>'
- var unchkIcon = '<img src="' + baseUrl + 'res/img/common/uncheck.gif"/>'
- $("#V_LOGINNAME").val(sessionStorage.getItem('V_LOGINNAME'));
- $("#V_PASSWORD").val(sessionStorage.getItem('V_PASSWORD'));
- V_LOGINNAME = $("#V_LOGINNAME").val();
- V_PASSWORD = $("#V_PASSWORD").val();
- var countPerPage = 15;
- var maxHeight = 10000;
- // var maxHeight1 = 10000;
- var chkBoolean = function (flag) {
- if (flag)
- return chkIcon;
- return unchkIcon;
- }
- var queryJson = new Object();
- queryJson.V_LOGINNAME = V_LOGINNAME;
- queryJson.V_PASSWORD = V_PASSWORD;
- // queryJson.COMMSTATUS = 'NO';
- if ((company_code != null) && (company_code != 'null') && (company_code.length > 0))
- queryJson.company_code = company_code;
- var clear_append_form1 = function () {
- Ext.getCmp('fa_team_name').setValue("");
- Ext.getCmp('fa_person_liable_id').setValue("");
- Ext.getCmp('MaintenancePersonListPageToolbar2').moveFirst();
- }
- myStore = Ext.create('Ext.data.Store', {
- model: 'MaintenancePerson',
- pageSize: countPerPage,
- proxy: {
- type: 'ajax',
- actionMethods: {
- create: 'POST',
- read: 'POST', // by default GET
- update: 'POST',
- destroy: 'POST'
- },
- url: baseUrl + 'iot/inspectorsx/getList',
- reader: {
- type: 'json',
- root: 'RESULT',
- totalProperty: 'totalCount'
- },
- extraParams: {
- queryJson: Ext.JSON.encode(queryJson)
- }
- },
- remoteSort: true
- });
- myStore2 = Ext.create('Ext.data.Store', {
- model: 'MaintenancePerson2',
- pageSize: countPerPage,
- proxy: {
- type: 'ajax',
- actionMethods: {
- create: 'POST',
- read: 'POST', // by default GET
- update: 'POST',
- destroy: 'POST'
- },
- url: baseUrl + 'iot/planteam/getList',
- reader: {
- type: 'json',
- root: 'RESULT',
- totalProperty: 'totalCount'
- },
- extraParams: {
- queryJson: Ext.JSON.encode(queryJson)
- }
- },
- // sorters:[{
- // property:'data_time',
- // direction:'DESC'
- // }],
- remoteSort: true
- });
- var mystore2_fun = function (id) {
- if (id == 0) {
- myStore2.on('load', function (myStore2, record) {
- for (var i = 0; i < record.length; i++) {
- var records = record[i];
- if (records.get('xh') == 1) {
- Ext.getCmp('MaintenancePersonListPanel2').getSelectionModel().select(records, true);
- }
- };
- });
- } else {
- myStore2.reload();
- myStore2.on('load', function (myStore2, record) {
- for (var i = 0; i < record.length; i++) {
- var records = record[i];
- if (records.get('id') == id) {
- Ext.getCmp('MaintenancePersonListPanel2').getSelectionModel().select(records, true);
- }
- };
- });
- }
- }
- myStore1 = Ext.create('Ext.data.Store', {
- model: 'MaintenancePerson1',
- pageSize: countPerPage,
- proxy: {
- type: 'ajax',
- actionMethods: {
- create: 'POST',
- read: 'POST', // by default GET
- update: 'POST',
- destroy: 'POST'
- },
- url: baseUrl + 'iot/inspectorsx/getTeamMembersList',
- reader: {
- type: 'json',
- root: 'RESULT',
- totalProperty: 'totalCount'
- },
- extraParams: {
- queryJson: Ext.JSON.encode(queryJson)
- }
- },
- // sorters:[{
- // property:'data_time',
- // direction:'DESC'
- // }],
- remoteSort: true
- });
- myStore1.on('load', function (myStore1, record) {
- // var index = myStore1.find('pd',1);
- // Ext.getCmp('MaintenancePersonListPanel3').getSelectionModel().select(index);
- for (var i = 0; i < record.length; i++) {
- var records = record[i];
- if (records.get('pd') == 1) {
- Ext.getCmp('MaintenancePersonListPanel3').getSelectionModel().select(records, true);
- }
- };
- });
- // myStore1.addListener('load',function(){
- // var records=[];//存放选中记录
- // for(var i=0;i<myStore1.getCount();i++){
- // var record = myStore1.getAt(i);
- // if(record.data.id==7){//根据后台数据判断那些记录默认选中
- // records.push(record);
- // }
- // }
- // sm.selectRecords(records);//执行选中记录
- // });
- Ext.define('getJobDutiesStore1', {
- extend: 'Ext.data.Model',
- fields: [
- { name: 'name', type: 'string' },
- { name: 'rid', type: 'int' }
- ]
- });
- var getJobDutiesStore1 = Ext.create('Ext.data.Store', {
- model: 'getJobDutiesStore1',
- proxy: {
- type: 'ajax',
- actionMethods: {
- create: 'POST',
- read: 'POST', // by default GET
- update: 'POST',
- destroy: 'POST'
- },
- url: baseUrl + 'iot/inspectorsx/getTeamMembersList1',
- reader: {
- type: 'json',
- root: 'RESULT',
- totalProperty: 'totalCount'
- },
- extraParams: {
- queryJson: Ext.JSON.encode(queryJson)
- }
- }
- });
- function public_phone(e) {
- if (!(/^1(?:3\d|4[4-9]|5[0-35-9]|6[67]|7[013-8]|8\d|9\d)\d{8}$/.test(e))) {
- Ext.Msg.alert('提示', '不是完整的11位手机号或者正确的手机号前七位!', function (btn, txt) {
- Ext.getCmp('fa_phone').setValue('');
- Ext.getCmp('fm_phone').setValue('');
- });
- return false;
- }
- }
- var AppendForm = Ext.create('Ext.form.Panel', {
- id: 'MaintenancePersonAppendForm',
- labelWidth: 55,
- url: baseUrl + 'iot/inspectorsx/append',
- defaultType: 'textfield',
- bodyPadding: 15,
- items: [{
- fieldLabel: '人员姓名',
- id: 'fa_name',
- name: 'name',
- maxLength: 20,
- maxLengthText: '长度不得超出{0}',
- anchor: '75%',
- listeners: {
- change: function (o, e) {
- if (e.length > 10) {
- Ext.Msg.alert('提示', '人员姓名长度不可超过10个字!', function (btn, txt) {
- Ext.getCmp('fa_name').setValue('');
- });
- return false;
- }
- }
- }
- }, {
- fieldLabel: '电话号码',
- id: 'fa_phone',
- name: 'phone',
- maxLength: 250,
- maxLengthText: '长度不得超出{0}',
- anchor: '75%',
- listeners: {
- change: function (o, e) {
- if (e.length == 11) {
- public_phone(e);
- } else {
- Ext.getCmp('fa_phone').setValue(e.substring(0, 11));
- e.length == 11 ? public_phone(e) : ''
- }
- }
- }
- }, {
- xtype: 'checkboxgroup',
- fieldLabel: '人员职能',
- id: "fa_maintenancePerson_inspectiontime",
- columns: 3,
- items: [
- { boxLabel: '维保', name: 'maintenance', inputValue: "1" },
- { boxLabel: '巡检', name: 'inspection', inputValue: "2" },
- { boxLabel: '报修', name: 'event_processing', inputValue: "4" }
- ]
- }, {
- id: 'fa_queryJson',
- name: 'queryJson',
- hidden: true
- }],
- buttons: [{
- text: '提交',
- iconCls: 'ok_btn',
- handler: function () {
- var form = this.up('form').getForm();
- if (form.isValid()) {
- var InspectiontimeValue = Ext.getCmp('fa_maintenancePerson_inspectiontime').getChecked();
- var Inspectiontime = 0;
- Ext.Array.each(InspectiontimeValue, function (item) {
- Inspectiontime += parseInt(item.inputValue);
- });
- var query = new Object();
- // query.V_LOGINNAME = V_LOGINNAME;
- query.name = Ext.getCmp('fa_name').getValue();
- if (query.name == null || query.name == "") {
- Ext.Msg.alert('系统提示', '人员姓名不能为空!');
- return;
- }
- query.phone = Ext.getCmp('fa_phone').getValue();
- if (query.phone == null || query.phone == "") {
- Ext.Msg.alert('系统提示', '电话号码不能为空!');
- return;
- } else if (query.phone.length < 11) {
- Ext.Msg.alert('系统提示', '请输入正确的电话号码!');
- return;
- }
- query.zn = Inspectiontime;
- if (query.zn == 0) {
- Ext.Msg.alert('系统提示', '职能至少选择一项!');
- return
- }
- var jsonstr = Ext.JSON.encode(query);
- Ext.getCmp('fa_queryJson').setValue(jsonstr);
- form.submit({
- method: 'post',
- success: function (form, action) {
- Ext.Msg.alert('操作成功', '已保存', function (btn, txt) {
- Ext.getCmp('MaintenancePersonAppendForm').getForm().reset();
- Ext.getCmp('MaintenancePersonListPageToolbar').moveFirst();
- });
- },
- failure: function (form, action) {
- Ext.Msg.alert('操作失败', action.Msg, function (btn, txt) {
- });
- }
- });
- }
- }
- }, {
- text: '关闭',
- iconCls: 'cancel_btn',
- handler: function () {
- this.up('window').hide();
- }
- }]
- });
- var appendwin = function () {
- Ext.create('Ext.window.Window', {
- title: '新增',
- height: 350,
- width: 400,
- modal: true,
- layout: 'fit',
- items: AppendForm,
- closeAction: 'hide'
- }).show();
- }
- Ext.define('getJobDutiesStore', {
- extend: 'Ext.data.Model',
- fields: [
- { name: 'owner_name', type: 'string' },
- { name: 'owner_id', type: 'string' }
- ]
- });
- var getJobDutiesStore = Ext.create('Ext.data.Store', {
- model: 'getJobDutiesStore',
- proxy: {
- type: 'ajax',
- actionMethods: {
- create: 'POST',
- read: 'POST', // by default GET
- update: 'POST',
- destroy: 'POST'
- },
- url: baseUrl + 'iot/company/view/getNameList',
- reader: {
- type: 'json',
- root: 'RESULT',
- totalProperty: 'totalCount'
- },
- extraParams: {
- queryJson: Ext.JSON.encode(queryJson)
- }
- }
- });
- var AppendForm1 = Ext.create('Ext.form.Panel', {
- id: 'MaintenancePersonAppendForm1',
- labelWidth: 55,
- url: baseUrl + 'iot/planteam/append',
- defaultType: 'textfield',
- bodyPadding: 15,
- items: [{
- fieldLabel: '班组名称',
- id: 'fa_team_name',
- name: 'team_name',
- maxLength: 20,
- maxLengthText: '长度不得超出{0}',
- anchor: '75%'
- }, {
- fieldLabel: '负责人',
- id: 'fa_person_liable_id',
- name: 'person_liable_id',
- xtype: 'combo',
- store: getJobDutiesStore1,
- displayField: 'name',
- valueField: 'rid',
- editable: false,
- anchor: '75%'
- }, {
- id: 'fa_queryJson1',
- name: 'queryJson',
- hidden: true
- }],
- buttons: [{
- text: '提交',
- iconCls: 'ok_btn',
- handler: function () {
- var form = this.up('form').getForm();
- if (form.isValid()) {
- var query = new Object();
- // query.V_LOGINNAME = $("#V_LOGINNAME").val();
- query.team_name = Ext.getCmp('fa_team_name').getValue();
- query.person_liable_id = Ext.getCmp('fa_person_liable_id').getValue();
- var jsonstr = Ext.JSON.encode(query);
- Ext.getCmp('fa_queryJson1').setValue(jsonstr);
- form.submit({
- method: 'post',
- success: function (form, action) {
- Ext.Msg.alert('操作成功', '已保存', function (btn, txt) {
- clear_append_form1();
- });
- },
- failure: function (form, action) {
- Ext.Msg.alert('操作失败', action.Msg, function (btn, txt) {
- clear_append_form1();
- });
- }
- });
- }
- }
- }, {
- text: '关闭',
- iconCls: 'cancel_btn',
- handler: function () {
- this.up('window').hide();
- }
- }]
- });
- var appendwin1 = function () {
- Ext.create('Ext.window.Window', {
- title: '新增',
- height: 350,
- modal: true,
- width: 400,
- layout: 'fit',
- items: AppendForm1,
- closeAction: 'hide'
- }).show();
- }
- var ModifyForm = Ext.create('Ext.form.Panel', {
- id: 'MaintenancePersonEditForm',
- labelWidth: 55,
- url: baseUrl + 'iot/inspectorsx/update',
- defaultType: 'textfield',
- bodyPadding: 15,
- items: [{
- fieldLabel: '人员姓名',
- id: 'fm_name',
- name: 'name',
- maxLength: 20,
- maxLengthText: '长度不得超出{0}',
- anchor: '75%',
- listeners: {
- change: function (o, e) {
- if (e.length > 20) {
- Ext.getCmp('fa_Inspectors_name').setValue(e.substring(0, 20));
- return;
- }
- }
- }
- }, {
- fieldLabel: '电话号码',
- id: 'fm_phone',
- name: 'phone',
- maxLength: 250,
- maxLengthText: '长度不得超出{0}',
- anchor: '75%',
- listeners: {
- change: function (o, e) {
- if (e.length == 11) {
- public_phone(e);
- } else {
- Ext.getCmp('fm_phone').setValue(e.substring(0, 11));
- e.length == 11 ? public_phone(e) : ''
- }
- }
- }
- }, {
- xtype: 'checkboxgroup',
- fieldLabel: '人员职能',
- id: "fm_maintenancePerson_inspectiontime",
- columns: 3,
- items: [
- { boxLabel: '维保', name: 'maintenance', inputValue: "1", id: 'maintenance' },
- { boxLabel: '巡检', name: 'inspection', inputValue: "2", id: 'inspection' },
- { boxLabel: '报修', name: 'event_processing', inputValue: "4", id: 'event_processing' }
- ]
- }, {
- id: 'fm_id',
- name: 'id',
- hidden: true
- }, {
- id: 'fm_queryJson',
- name: 'queryJson',
- hidden: true
- }],
- buttons: [{
- text: '修改',
- iconCls: 'ok_btn',
- handler: function () {
- var form = this.up('form').getForm();
- if (form.isValid()) {
- var InspectiontimeValue = Ext.getCmp('fm_maintenancePerson_inspectiontime').getChecked();
- var Inspectiontime = 0;
- Ext.Array.each(InspectiontimeValue, function (item) {
- Inspectiontime += parseInt(item.inputValue);
- });
- var query = new Object();
- query.name = Ext.getCmp('fm_name').getValue();
- if (query.name == null || query.name == "") {
- Ext.Msg.alert('系统提示', '人员姓名不能为空!');
- return;
- }
- query.phone = Ext.getCmp('fm_phone').getValue();
- if (query.phone == null || query.phone == "") {
- Ext.Msg.alert('系统提示', '电话号码不能为空!');
- return;
- } else if (query.phone.length < 11) {
- Ext.Msg.alert('系统提示', '请输入正确的电话号码!');
- return;
- }
- query.zn = Inspectiontime;
- if (query.zn == 0) {
- Ext.Msg.alert('系统提示', '职能至少选择一项!');
- return
- }
- query.id = Ext.getCmp('fm_id').getValue();
- var jsonstr = Ext.JSON.encode(query);
- Ext.getCmp('fm_queryJson').setValue(jsonstr);
- form.submit({
- method: 'post',
- success: function (form, action) {
- Ext.Msg.alert('操作成功', '已修改', function (btn, txt) {
- Ext.getCmp('MaintenancePersonEditForm').getForm().reset();
- Ext.getCmp('MaintenancePersonListPanel').getStore().reload();
- });
- },
- failure: function (form, action) {
- Ext.Msg.alert('操作失败', action.Msg, function (btn, txt) {
- Ext.getCmp('MaintenancePersonEditForm').getForm().reset();
- Ext.getCmp('MaintenancePersonListPanel').getStore().reload();
- });
- }
- });
- this.up('window').hide();
- }
- }
- }, {
- text: '关闭',
- iconCls: 'cancel_btn',
- handler: function () {
- this.up('window').hide();
- Ext.getCmp('MaintenancePersonEditForm').getForm().reset();
- Ext.getCmp('MaintenancePersonListPanel').getStore().reload();
- }
- }]
- });
- var modifywin = function () {
- Ext.create('Ext.window.Window', {
- title: '修改',
- height: 350,
- width: 400,
- modal: true,
- layout: 'fit',
- items: ModifyForm,
- closeAction: 'hide'
- }).show();
- }
- var chk_sm = function () {
- if (sm.getCount() == 1) {
- modifywin();
- var selected = sm.getSelection();
- var fm_inspectiontime = selected[0].raw.zn
- if (fm_inspectiontime == '1') {
- var domainArr = ['1'];
- } else if (fm_inspectiontime == '2') {
- var domainArr = ['2'];
- } else if (fm_inspectiontime == '3') {
- var domainArr = ['1', '2'];
- } else if (fm_inspectiontime == '4') {
- var domainArr = ['4'];
- } else if (fm_inspectiontime == '5') {
- var domainArr = ['1', '4'];
- } else if (fm_inspectiontime == '6') {
- var domainArr = ['2', '4'];
- } else if (fm_inspectiontime == '7') {
- var domainArr = ['1', '2', '4'];
- }
- for (var i = 0; i < domainArr.length; i++) {
- switch (domainArr[i]) {
- case "1":
- Ext.getCmp('maintenance').setValue(true);
- break;
- case "2":
- Ext.getCmp('inspection').setValue(true);
- break;
- case "4":
- Ext.getCmp('event_processing').setValue(true);
- break;
- }
- }
- Ext.getCmp('fm_id').setValue(selected[0].raw.id);
- Ext.getCmp('fm_name').setValue(selected[0].raw.name);
- Ext.getCmp('fm_phone').setValue(selected[0].raw.phone);
- } else {
- Ext.Msg.alert('请先选择', '请先选择一条记录,再点击修改');
- }
- }
- var del_sm = function () {
- if (sm.getCount() == 1) {
- var selected = sm.getSelection();
- var query = new Object();
- var list = new Array();
- var o = new Object();
- o.id = selected[0].raw.id;
- list.push(o);
- query.ID_LIST = list;
- var jsonstr = Ext.JSON.encode(query);
- Ext.MessageBox.confirm('删除人员信息', '是否删除' + selected[0].raw.name + ' 维保人员?', function (btn) {
- if (btn == 'yes') {
- $.ajax({
- type: 'POST',
- url: baseUrl + "iot/inspectorsx/del",
- data: {
- queryJson: jsonstr
- },
- success: function (result) {
- var json = eval('(' + result + ')');
- if (json.action == 'deleteInspectors') {
- if (json.success == true) {
- Ext.Msg.alert('操作成功', json.MSG, function (btn, txt) {
- Ext.getCmp('MaintenancePersonListPanel').getStore().reload();
- });
- } else {
- Ext.Msg.alert('操作失败', json.MSG, function (btn, txt) {
- Ext.getCmp('MaintenancePersonListPanel').getStore().reload();
- });
- }
- }
- }
- });
- }
- }, this);
- } else {
- if (sm.getCount() > 1) {
- var query = new Object();
- var list = new Array();
- for (var i = 0; i < sm.getCount(); i++) {
- var selected = sm.getSelection();
- var o = new Object();
- o.id = selected[i].raw.id;
- list.push(o);
- }
- query.ID_LIST = list;
- var jsonstr = Ext.JSON.encode(query);
- Ext.MessageBox.confirm('删除人员信息', '是否删除选中的' + sm.getCount() + ' 个维保人员?', function (btn) {
- if (btn == 'yes') {
- // Ext.Ajax.request( {
- // timeout : 3000000,
- // url: baseUrl+'iot/inspectorsx/del',
- // params : 'queryJson='+ jsonstr,
- // success: function(resp,opts){
- // myStore.reload();
- // }
- // });
- $.ajax({
- type: 'POST',
- url: baseUrl + "iot/inspectorsx/del",
- data: {
- queryJson: jsonstr
- },
- success: function (result) {
- var json = eval('(' + result + ')');
- if (json.action == 'deleteInspectors') {
- if (json.success == true) {
- Ext.Msg.alert('操作成功', json.MSG, function (btn, txt) {
- Ext.getCmp('MaintenancePersonListPanel').getStore().reload();
- });
- } else {
- Ext.Msg.alert('操作失败', json.MSG, function (btn, txt) {
- Ext.getCmp('MaintenancePersonListPanel').getStore().reload();
- });
- }
- }
- }
- });
- }
- }, this);
- } else {
- Ext.Msg.alert('请先选择', '至少选择一条记录,再点击删除');
- }
- }
- }
- var del_sm1 = function () {
- if (sm1.getCount() == 1) {
- var selected = sm1.getSelection();
- var query = new Object();
- var list = new Array();
- var o = new Object();
- o.id = selected[0].raw.id;
- list.push(o);
- query.ID_LIST = list;
- var jsonstr = Ext.JSON.encode(query);
- Ext.MessageBox.confirm('删除班组', '是否删除' + selected[0].raw.name + ' 班组?', function (btn) {
- if (btn == 'yes') {
- $.ajax({
- type: 'POST',
- url: baseUrl + "iot/planteam/del",
- data: {
- queryJson: jsonstr
- },
- success: function (result) {
- var json = eval('(' + result + ')');
- if (json.action == 'deletePlanTeam') {
- if (json.success == true) {
- Ext.Msg.alert('操作成功', json.MSG, function (btn, txt) {
- Ext.getCmp('MaintenancePersonListPanel2').getStore().reload();
- });
- } else {
- Ext.Msg.alert('操作失败', json.MSG, function (btn, txt) {
- Ext.getCmp('MaintenancePersonListPanel2').getStore().reload();
- });
- }
- }
- }
- });
- }
- }, this);
- } else {
- if (sm1.getCount() > 1) {
- var query = new Object();
- var list = new Array();
- for (var i = 0; i < sm.getCount(); i++) {
- var selected = sm1.getSelection();
- var o = new Object();
- o.id = selected[i].raw.id;
- list.push(o);
- }
- query.ID_LIST = list;
- var jsonstr = Ext.JSON.encode(query);
- Ext.MessageBox.confirm('删除班组', '是否删除选中的' + sm1.getCount() + ' 个班组?', function (btn) {
- if (btn == 'yes') {
- $.ajax({
- type: 'POST',
- url: baseUrl + "iot/planteam/del",
- data: {
- queryJson: jsonstr
- },
- success: function (result) {
- var json = eval('(' + result + ')');
- if (json.action == 'deletePlanTeam') {
- if (json.success == true) {
- Ext.Msg.alert('操作成功', json.MSG, function (btn, txt) {
- Ext.getCmp('MaintenancePersonListPanel2').getStore().reload();
- });
- } else {
- Ext.Msg.alert('操作失败', json.MSG, function (btn, txt) {
- Ext.getCmp('MaintenancePersonListPanel2').getStore().reload();
- });
- }
- }
- }
- });
- }
- }, this);
- } else {
- Ext.Msg.alert('请先选择', '至少选择一条记录,再点击删除');
- }
- }
- }
- var show_page = function () {
- var arr = 0;
- var r = document.getElementsByName("zhineng");
- if (r.length > 1) {
- for (var i = 0; i < r.length; i++) {
- if (r[i].checked) {
- arr += parseInt(r[i].value);
- }
- }
- } else if (r.length == 1) {
- arr = parseInt(r[0].value);
- } else {
- arr = 0;
- }
- var maintenancePerson_title3_input = document.getElementById('maintenancePerson_title3_input1').value;
- var query = new Object();
- if (arr > 0) {
- query.zn = arr;
- $("#zn").val(arr);
- }
- if (maintenancePerson_title3_input.length > 0) {
- query.name = maintenancePerson_title3_input;
- $("#name").val(maintenancePerson_title3_input);
- }
- // query.V_LOGINNAME = V_LOGINNAME;
- // query.V_PASSWORD = V_PASSWORD;
- var jsonstr = Ext.JSON.encode(query);
- myStore.getProxy().extraParams = {
- queryJson: jsonstr
- };
- Ext.getCmp('MaintenancePersonListPageToolbar').moveFirst();
- }
- var show_page1 = function () {
- var maintenancePerson_title21_input = document.getElementById('maintenancePerson_title21_input').value;
- var maintenancePerson_title31_input = document.getElementById('maintenancePerson_title31_input1').value;
- var query = new Object();
- if (maintenancePerson_title21_input.length > 0) {
- query.spot_name = maintenancePerson_title21_input;
- }
- if (maintenancePerson_title31_input.length > 0) {
- query.name = maintenancePerson_title31_input;
- }
- // query.V_LOGINNAME = V_LOGINNAME;
- // query.V_PASSWORD = V_PASSWORD;
- var jsonstr = Ext.JSON.encode(query);
- myStore.getProxy().extraParams = {
- queryJson: jsonstr
- };
- Ext.getCmp('MaintenancePersonListPageToolbar2').moveFirst();
- }
- var reset1 = function () {
- var zn = document.getElementsByName("zhineng");
- for (var i = 0; i < zn.length; i++) {
- zn[i].checked = true;
- }
- document.getElementById('maintenancePerson_title3_input1').value = '';
- $("#zn").val('');
- $("#name").val('');
- show_page();
- }
- var reset11 = function () {
- document.getElementById('maintenancePerson_title21_input').value = '';
- document.getElementById('maintenancePerson_title31_input1').value = '';
- }
- mouseon = function (obj) {
- var id = obj.id;
- $("#" + id).removeClass(id);
- $("#" + id).addClass(id + '_on');
- }
- mouseon1 = function (obj) {
- var id = obj.id;
- $("#" + id).removeClass(id);
- $("#" + id).addClass(id + '_on');
- }
- mouseoff = function (obj) {
- var mid = "maintenancePerson_";
- for (var i = 1; i < 7; i++) {
- var id = "maintenancePerson_title" + i + "_div";
- $("#" + id).removeClass(id + '_on');
- $("#" + id).addClass(id);
- }
- if (menuidx == 'm1') {
- mid += 'title1_div';
- $("#" + mid).removeClass(mid);
- $("#" + mid).addClass(mid + '_on');
- }
- else if (menuidx == 'm2') {
- mid += 'title2_div';
- $("#" + mid).removeClass(mid);
- $("#" + mid).addClass(mid + '_on');
- }
- else if (menuidx == 'm3') {
- mid += 'title3_div';
- $("#" + mid).removeClass(mid);
- $("#" + mid).addClass(mid + '_on');
- }
- else if (menuidx == 'm4') {
- mid += 'title4_div';
- $("#" + mid).removeClass(mid);
- $("#" + mid).addClass(mid + '_on');
- }
- else if (menuidx == 'm5') {
- mid += 'title5_div';
- $("#" + mid).removeClass(mid);
- $("#" + mid).addClass(mid + '_on');
- }
- else if (menuidx == 'm6') {
- mid += 'title6_div';
- $("#" + mid).removeClass(mid);
- $("#" + mid).addClass(mid + '_on');
- }
- }
- mouseoff1 = function (obj) {
- var mid = "maintenancePerson_";
- for (var i = 1; i < 5; i++) {
- var id = "maintenancePerson_title" + i + "1_div";
- $("#" + id).removeClass(id + '_on');
- $("#" + id).addClass(id);
- }
- if (menuidx == 'm11') {
- mid += 'title11_div';
- $("#" + mid).removeClass(mid);
- $("#" + mid).addClass(mid + '_on');
- }
- else if (menuidx == 'm21') {
- mid += 'title21_div';
- $("#" + mid).removeClass(mid);
- $("#" + mid).addClass(mid + '_on');
- }
- else if (menuidx == 'm31') {
- mid += 'title31_div';
- $("#" + mid).removeClass(mid);
- $("#" + mid).addClass(mid + '_on');
- }
- else if (menuidx == 'm41') {
- mid += 'title41_div';
- $("#" + mid).removeClass(mid);
- $("#" + mid).addClass(mid + '_on');
- }
- }
- menu_click = function (obj) {
- var id = obj.id;
- if (id == 'maintenancePerson_title1_div') {
- menuidx = 'm1';
- show_page();
- }
- else if (id == 'maintenancePerson_title2_div') {
- menuidx = 'm2';
- reset1();
- }
- else if (id == 'maintenancePerson_title3_div') {
- menuidx = 'm3';
- exportbtn_click();
- }
- else if (id == 'maintenancePerson_title4_div') {
- menuidx = 'm4';
- del_sm();
- }
- else if (id == 'maintenancePerson_title5_div') {
- menuidx = 'm5';
- appendwin();
- }
- else if (id == 'maintenancePerson_title6_div') {
- menuidx = 'm6';
- chk_sm();
- }
- else if (id == 'maintenancePerson_title11_div') {
- menuidx = 'm11';
- del_sm1();
- }
- else if (id == 'maintenancePerson_title21_div') {
- menuidx = 'm21';
- appendwin1();
- }
- else if (id == 'maintenancePerson_title31_div') {
- menuidx = 'm31';
- Preservation_panel3();
- }
- else if (id == 'maintenancePerson_title41_div') {
- menuidx = 'm41';
- cancel_panel3();
- }
- }
- var Preservation_panel3 = function () {
- var team_name = document.getElementById('maintenancePerson_title211_input').value;
- var person_liable_id = document.getElementById('maintenancePerson_title111_input').value;
- var selected = sm1.getSelection();
- var selected1 = addsm.getSelection();
- var tid = selected1[0].raw.tdid;
- for (var i = 0; i < addsm.getCount(); i++) {
- if (i == 0)
- people_id_list = selected1[i].raw.rid;
- else
- people_id_list += "," + selected1[i].raw.rid;
- }
- var query = new Object();
- query.team_name = team_name;
- query.person_liable_id = person_liable_id;
- query.tid = tid;
- query.people_id_list = people_id_list;
- $.ajax({
- type: 'POST',
- url: baseUrl + "iot/planteam/update",
- data: {
- queryJson: Ext.JSON.encode(query)
- },
- success: function (result) {
- Ext.Msg.alert('操作成功', '已修改', function (btn, txt) {
- mystore2_fun(tid);
- // cancel_panel3();
- });
- },
- failure: function () {
- Ext.Msg.alert('操作失败', function (btn, txt) {
- cancel_panel3();
- });
- }
- });
- }
- var cancel_panel3 = function () {
- var selected = sm1.getSelection();
- var stor1_id = selected[0].raw.id;
- var label1 = selected[0].raw.team_name;
- var label2 = selected[0].raw.person_liable_id;
- var query = new Object();
- query.id = stor1_id;
- // query.V_LOGINNAME = V_LOGINNAME;
- // query.V_PASSWORD = V_PASSWORD;
- var jsonstr = Ext.JSON.encode(query);
- myStore1.getProxy().extraParams = {
- queryJson: jsonstr
- };
- Ext.getCmp('MaintenancePersonListPageToolbar3').moveFirst();
- document.getElementById('maintenancePerson_title211_input').value = label1;
- document.getElementById('maintenancePerson_title111_input').value = label2;
- }
- // var childPanel1 = Ext.create('Ext.Panel', {
- // height:188,
- // width:'100%',
- // html: '<div class="title2_div">角色</div><input type="text" class="input_class" id="maintenancePerson_title2_input" value=""><div class="title3_div">姓名</div><input type="text" class="input1_class" id="maintenancePerson_title3_input1" value=""><div id="maintenancePerson_title1_div" class="maintenancePerson_title1_div" onmouseover="mouseon(this);" onmouseout="mouseoff(this);" onclick="menu_click(this);"></div><div id="maintenancePerson_title2_div" class="maintenancePerson_title2_div" onmouseover="mouseon(this);" onmouseout="mouseoff(this);" onclick="menu_click(this);"></div><div id="maintenancePerson_title3_div" class="maintenancePerson_title3_div" onmouseover="mouseon(this);" onmouseout="mouseoff(this);" onclick="menu_click(this);"></div><div id="maintenancePerson_title4_div" class="maintenancePerson_title4_div" onmouseover="mouseon(this);" onmouseout="mouseoff(this);" onclick="menu_click(this);"></div><div id="maintenancePerson_title5_div" class="maintenancePerson_title5_div" onmouseover="mouseon(this);" onmouseout="mouseoff(this);" onclick="menu_click(this);"></div><div id="maintenancePerson_title6_div" class="maintenancePerson_title6_div" onmouseover="mouseon(this);" onmouseout="mouseoff(this);" onclick="menu_click(this);"></div>'
- // });
- var childPanel1 = function () {
- var maintenancePersonHtml = document.getElementById('maintenancePersonHtml');
- var childPanel1_title = document.createElement('div');
- childPanel1_title.setAttribute('class', 'maintenanceperson_title2_div');
- childPanel1_title.innerHTML = '职能';
- maintenancePersonHtml.appendChild(childPanel1_title);
- var childPanel1_input1 = document.createElement('input');
- childPanel1_input1.setAttribute('class', 'input4_class');
- // childPanel1_input1.setAttribute('id','maintenancePerson_title3_input1');
- childPanel1_input1.setAttribute('type', 'checkbox');
- childPanel1_input1.setAttribute('name', 'zhineng');
- childPanel1_input1.setAttribute('value', '1');
- maintenancePersonHtml.appendChild(childPanel1_input1);
- var childPanel1_div = document.createElement('div');
- childPanel1_div.setAttribute('class', 'childPanel1_div');
- childPanel1_div.innerHTML = '维保';
- maintenancePersonHtml.appendChild(childPanel1_div);
- var childPanel1_input2 = document.createElement('input');
- childPanel1_input2.setAttribute('class', 'input2_class');
- // childPanel1_input1.setAttribute('id','maintenancePerson_title3_input1');
- childPanel1_input2.setAttribute('type', 'checkbox');
- childPanel1_input2.setAttribute('name', 'zhineng');
- childPanel1_input2.setAttribute('value', '2');
- maintenancePersonHtml.appendChild(childPanel1_input2);
- var childPanel1_div1 = document.createElement('div');
- childPanel1_div1.setAttribute('class', 'childPanel1_div1');
- childPanel1_div1.innerHTML = '巡检';
- maintenancePersonHtml.appendChild(childPanel1_div1);
- var childPanel1_input3 = document.createElement('input');
- childPanel1_input3.setAttribute('class', 'input3_class');
- // childPanel1_input1.setAttribute('id','maintenancePerson_title3_input1');
- childPanel1_input3.setAttribute('type', 'checkbox');
- childPanel1_input3.setAttribute('name', 'zhineng');
- childPanel1_input3.setAttribute('value', '4');
- maintenancePersonHtml.appendChild(childPanel1_input3);
- var childPanel1_div2 = document.createElement('div');
- childPanel1_div2.setAttribute('class', 'childPanel1_div2');
- childPanel1_div2.innerHTML = '报修';
- maintenancePersonHtml.appendChild(childPanel1_div2);
- var childPanel1_title1 = document.createElement('div');
- childPanel1_title1.setAttribute('class', 'title3_div');
- childPanel1_title1.innerHTML = '姓名';
- maintenancePersonHtml.appendChild(childPanel1_title1);
- var childPanel1_input = document.createElement('input');
- childPanel1_input.setAttribute('class', 'input1_class');
- childPanel1_input.setAttribute('id', 'maintenancePerson_title3_input1');
- childPanel1_input.setAttribute('type', 'text');
- childPanel1_input.setAttribute('value', '');
- maintenancePersonHtml.appendChild(childPanel1_input);
- var childPanel1_title2 = document.createElement('div');
- childPanel1_title2.setAttribute('class', 'maintenancePerson_title1_div');
- childPanel1_title2.setAttribute('id', 'maintenancePerson_title1_div');
- childPanel1_title2.setAttribute('onmouseover', "mouseon(this)");
- childPanel1_title2.setAttribute('onmouseout', "mouseoff(this)");
- childPanel1_title2.setAttribute('onclick', "menu_click(this)");
- maintenancePersonHtml.appendChild(childPanel1_title2);
- var childPanel1_title3 = document.createElement('div');
- childPanel1_title3.setAttribute('class', 'maintenancePerson_title2_div');
- childPanel1_title3.setAttribute('id', 'maintenancePerson_title2_div');
- childPanel1_title3.setAttribute('onmouseover', "mouseon(this)");
- childPanel1_title3.setAttribute('onmouseout', "mouseoff(this)");
- childPanel1_title3.setAttribute('onclick', "menu_click(this)");
- maintenancePersonHtml.appendChild(childPanel1_title3);
- var childPanel1_title4 = document.createElement('div');
- childPanel1_title4.setAttribute('class', 'maintenancePerson_title3_div');
- childPanel1_title4.setAttribute('id', 'maintenancePerson_title3_div');
- childPanel1_title4.setAttribute('onmouseover', "mouseon(this)");
- childPanel1_title4.setAttribute('onmouseout', "mouseoff(this)");
- childPanel1_title4.setAttribute('onclick', "menu_click(this)");
- maintenancePersonHtml.appendChild(childPanel1_title4);
- var childPanel1_title5 = document.createElement('div');
- childPanel1_title5.setAttribute('class', 'maintenancePerson_title4_div');
- childPanel1_title5.setAttribute('id', 'maintenancePerson_title4_div');
- childPanel1_title5.setAttribute('onmouseover', "mouseon(this)");
- childPanel1_title5.setAttribute('onmouseout', "mouseoff(this)");
- childPanel1_title5.setAttribute('onclick', "menu_click(this)");
- maintenancePersonHtml.appendChild(childPanel1_title5);
- var childPanel1_title6 = document.createElement('div');
- childPanel1_title6.setAttribute('class', 'maintenancePerson_title5_div');
- childPanel1_title6.setAttribute('id', 'maintenancePerson_title5_div');
- childPanel1_title6.setAttribute('onmouseover', "mouseon(this)");
- childPanel1_title6.setAttribute('onmouseout', "mouseoff(this)");
- childPanel1_title6.setAttribute('onclick', "menu_click(this)");
- maintenancePersonHtml.appendChild(childPanel1_title6);
- var childPanel1_title7 = document.createElement('div');
- childPanel1_title7.setAttribute('class', 'maintenancePerson_title6_div');
- childPanel1_title7.setAttribute('id', 'maintenancePerson_title6_div');
- childPanel1_title7.setAttribute('onmouseover', "mouseon(this)");
- childPanel1_title7.setAttribute('onmouseout', "mouseoff(this)");
- childPanel1_title7.setAttribute('onclick', "menu_click(this)");
- maintenancePersonHtml.appendChild(childPanel1_title7);
- reset1();
- }
- changeon1 = function (obj) {
- var selected = sm1.getSelection();
- var id = selected[0].raw.id
- var xid = obj.value;
- var query = new Object();
- if (xid.length > 0) {
- query.xid = xid;
- }
- query.id = id;
- // query.V_LOGINNAME = V_LOGINNAME;
- // query.V_PASSWORD = V_PASSWORD;
- var jsonstr = Ext.JSON.encode(query);
- myStore1.getProxy().extraParams = {
- queryJson: jsonstr
- };
- Ext.getCmp('MaintenancePersonListPageToolbar3').moveFirst();
- }
- var childPanel2 = function () {
- var maintenancePersonHtml2 = document.getElementById('maintenancePersonHtml2');
- var divhiddle = document.createElement('div');
- divhiddle.id = 'div26_id_maintenancePersonPanel3';
- divhiddle.setAttribute('class', 'SpringHandleHtml3DivHiddle');
- maintenancePersonHtml2.appendChild(divhiddle);
- var title = document.createElement('div');
- title.setAttribute('class', 'MaintenancePersonTitle123');
- title.innerHTML = '班组列表';
- maintenancePersonHtml2.appendChild(title);
- var childPanel2_title2 = document.createElement('div');
- childPanel2_title2.setAttribute('class', 'maintenancePerson_title11_div');
- childPanel2_title2.setAttribute('id', 'maintenancePerson_title11_div');
- childPanel2_title2.setAttribute('onmouseover', "mouseon1(this)");
- childPanel2_title2.setAttribute('onmouseout', "mouseoff1(this)");
- childPanel2_title2.setAttribute('onclick', "menu_click(this)");
- maintenancePersonHtml2.appendChild(childPanel2_title2);
- var childPanel2_title3 = document.createElement('div');
- childPanel2_title3.setAttribute('class', 'maintenancePerson_title21_div');
- childPanel2_title3.setAttribute('id', 'maintenancePerson_title21_div');
- childPanel2_title3.setAttribute('onmouseover', "mouseon1(this)");
- childPanel2_title3.setAttribute('onmouseout', "mouseoff1(this)");
- childPanel2_title3.setAttribute('onclick', "menu_click(this)");
- maintenancePersonHtml2.appendChild(childPanel2_title3);
- }
- var childPanel3 = function () {
- var maintenancePersonHtml3 = document.getElementById('maintenancePersonHtml3');
- var divhiddle = document.createElement('div');
- divhiddle.id = 'div26_id_maintenancePersonHtml3Panel3';
- divhiddle.setAttribute('class', 'SpringHandleHtml3DivHiddle');
- maintenancePersonHtml3.appendChild(divhiddle);
- var title1 = document.createElement('div');
- title1.setAttribute('class', 'MaintenancePersonTitle123');
- title1.innerHTML = '班组详情';
- maintenancePersonHtml3.appendChild(title1);
- var childPanel2_title = document.createElement('div');
- childPanel2_title.setAttribute('class', 'maintenancePerson_title211_div');
- childPanel2_title.innerHTML = '班组名称';
- maintenancePersonHtml3.appendChild(childPanel2_title);
- var childPanel2_input = document.createElement('input');
- childPanel2_input.setAttribute('class', 'maintenancePerson_input211_class');
- childPanel2_input.setAttribute('id', 'maintenancePerson_title211_input');
- childPanel2_input.setAttribute('type', 'text');
- childPanel2_input.setAttribute('value', '');
- maintenancePersonHtml3.appendChild(childPanel2_input);
- var childPanel2_title1 = document.createElement('div');
- childPanel2_title1.setAttribute('class', 'maintenancePerson_title111_div');
- childPanel2_title1.innerHTML = '负责人';
- maintenancePersonHtml3.appendChild(childPanel2_title1);
- var select = document.createElement('select');
- select.setAttribute('class', 'maintenancePerson_input111_class');
- select.setAttribute('onchange', "changeon1(this)");
- select.setAttribute('id', 'maintenancePerson_title111_input');
- maintenancePersonHtml3.appendChild(select);
- for (var i = 0; i < ConfirmStore.length; i++) {
- var option3 = document.createElement('option');
- option3.innerHTML = ConfirmStore[i].name;
- option3.setAttribute('value', ConfirmStore[i].rid);
- select.appendChild(option3);
- }
- var childPanel2_title2 = document.createElement('div');
- childPanel2_title2.setAttribute('class', 'maintenancePerson_title31_div');
- childPanel2_title2.setAttribute('id', 'maintenancePerson_title31_div');
- childPanel2_title2.setAttribute('onmouseover', "mouseon1(this)");
- childPanel2_title2.setAttribute('onmouseout', "mouseoff1(this)");
- childPanel2_title2.setAttribute('onclick', "menu_click(this)");
- maintenancePersonHtml3.appendChild(childPanel2_title2);
- var childPanel2_title3 = document.createElement('div');
- childPanel2_title3.setAttribute('class', 'maintenancePerson_title41_div');
- childPanel2_title3.setAttribute('id', 'maintenancePerson_title41_div');
- childPanel2_title3.setAttribute('onmouseover', "mouseon1(this)");
- childPanel2_title3.setAttribute('onmouseout', "mouseoff1(this)");
- childPanel2_title3.setAttribute('onclick', "menu_click(this)");
- maintenancePersonHtml3.appendChild(childPanel2_title3);
- }
- var childPanel3_fun = function () {
- var query = new Object();
- query.V_LOGINNAME = $("#V_LOGINNAME").val();
- $.ajax({
- type: 'POST',
- url: baseUrl + "iot/inspectorsx/getTeamMembersList1",
- data: {
- queryJson: Ext.JSON.encode(query)
- },
- success: function (result) {
- var json = eval('(' + result + ')');
- if (json.action == 'getTeamMembersList') {
- ConfirmStore = json.RESULT;
- childPanel3();
- }
- }
- });
- }
- var childPanel6 = Ext.create('Ext.Panel', {
- height: maxHeight,
- width: '20%',
- html: '<div></div>'
- });
- var MaintenancePersonPanel = Ext.create('Ext.grid.Panel', {
- header: {
- height: 0,
- border: '0px solid #000000'
- },
- id: 'MaintenancePersonListPanel',
- store: myStore,
- selModel: sm,
- columns: [
- { header: 'ID', dataIndex: 'id', hidden: true, menuDisabled: true },
- { header: '职能ID', dataIndex: 'zn', hidden: true, menuDisabled: true },
- { header: '序号', dataIndex: 'xh', width: 39, menuDisabled: true },
- { header: '姓名', dataIndex: 'name', width: 466, align: 'center', menuDisabled: true },
- { header: '手机号', dataIndex: 'phone', width: 466, align: 'center', menuDisabled: true },
- { header: '职务', dataIndex: 'zn_name', width: 466, align: 'center', menuDisabled: true },
- ],
- columnLines: true,
- height: maxHeight,
- width: '100%',
- bbar: new Ext.PagingToolbar({
- store: myStore,
- id: 'MaintenancePersonListPageToolbar',
- displayInfo: true,
- pageSize: countPerPage,
- prependButtons: true,
- displayMsg: '显示第 {0}条到 {1}条记录,总共 {2}条',
- emptyMsg: "没有记录",
- firstText: '第一页',
- prevText: '前一页',
- nextText: '后一页',
- lastText: '最后一页',
- refreshText: '刷新',
- }),
- frame: true,
- border: false,
- iconCls: 'icon-grid'
- });
- var MaintenancePersonPanel2 = Ext.create('Ext.grid.Panel', {
- header: {
- height: 0,
- border: '0px solid #000000'
- },
- bodyStyle: 'background:#121E34;',
- id: 'MaintenancePersonListPanel2',
- store: myStore2,
- region: 'center',
- selModel: sm1,
- columns: [
- { header: 'ID', dataIndex: 'id', hidden: true, menuDisabled: true },
- { header: '责任人ID', dataIndex: 'person_liable_id', hidden: true, menuDisabled: true },
- { header: '序号', dataIndex: 'xh', width: 35, menuDisabled: true },
- { header: '班组名称', dataIndex: 'team_name', width: 340, align: 'center', menuDisabled: true },
- ],
- columnLines: true,
- height: maxHeight,
- width: '30%',
- listeners: {
- select: function (dataview, record, index) {//record被选中时产生的事件
- var label = record.get('team_name');
- var label1 = record.get('id');
- var label2 = record.get('person_liable_id');
- var query = new Object();
- if (label1.length > 0) {
- query.id = label1;
- }
- // query.V_LOGINNAME = V_LOGINNAME;
- // query.V_PASSWORD = V_PASSWORD;
- var jsonstr = Ext.JSON.encode(query);
- myStore1.getProxy().extraParams = {
- queryJson: jsonstr
- };
- Ext.getCmp('MaintenancePersonListPageToolbar3').moveFirst();
- document.getElementById('maintenancePerson_title211_input').value = label;
- document.getElementById('maintenancePerson_title111_input').value = label2;
- // Ext.MessageBox.alert("标题触发了"+label);
- }
- // itemdblclick: function () {
- // Ext.MessageBox.alert("标题离开了");
- // }
- },
- bbar: new Ext.PagingToolbar({
- store: myStore2,
- id: 'MaintenancePersonListPageToolbar2',
- // displayInfo: true,
- // pageSize: countPerPage,
- // prependButtons: true,
- // displayMsg : '显示第 {0}条到 {1}条记录,总共 {2}条',
- // emptyMsg : "没有记录",
- // firstText: '第一页',
- // prevText: '前一页',
- // nextText: '后一页',
- // lastText: '最后一页',
- // refreshText: '刷新',
- }),
- // frame: true,
- border: false,
- iconCls: 'icon-grid'
- });
- var MaintenancePersonPanel3 =
- Ext.create('Ext.grid.Panel', {
- header: {
- height: 0,
- border: '0px solid #000000'
- },
- id: 'MaintenancePersonListPanel3',
- store: myStore1,
- region: 'center',
- selModel: addsm,
- columns: [
- { header: 'ID', dataIndex: 'rid', hidden: true, menuDisabled: true },
- { header: '责任人ID', dataIndex: 'person_liable_id', hidden: true, menuDisabled: true },
- { header: '班组ID', dataIndex: 'tdid', hidden: true, menuDisabled: true },
- { header: '默认值', dataIndex: 'pd', hidden: true, menuDisabled: true },
- { header: '序号', dataIndex: 'xh', width: 35, menuDisabled: true },
- { header: '组员', dataIndex: 'name', width: 633, align: 'center', menuDisabled: true },
- // { header: '', dataIndex: 'zrr', width:267,align:'center', menuDisabled:true },
- ],
- columnLines: true,
- height: maxHeight,
- width: '50%',
- listeners: {
- viewready: function () {
- var hd_checker = this.getEl().select('div.x-grid3-hd-checker');
- // if (hd_checker.hasClass('x-grid3-hd-checker')) {
- // hd_checker.removeClass('x-grid3-hd-checker'); // 去掉全选框
- // }
- }
- },
- bbar: new Ext.PagingToolbar({
- store: myStore1,
- id: 'MaintenancePersonListPageToolbar3',
- displayInfo: true,
- pageSize: countPerPage,
- prependButtons: true,
- displayMsg: '显示第 {0}条到 {1}条记录,总共 {2}条',
- emptyMsg: "没有记录",
- firstText: '第一页',
- prevText: '前一页',
- nextText: '后一页',
- lastText: '最后一页',
- refreshText: '刷新',
- }),
- border: false,
- iconCls: 'icon-grid'
- });
- var piebar = Ext.create('Ext.panel.Panel', {
- id: 'maintenancePersonHtml',
- width: '100%',
- height: 188,
- region: 'north',
- layout: 'form',
- defaults: {
- border: false
- }
- // items: [childPanel1]
- });
- var piebar2 = Ext.create('Ext.panel.Panel', {
- id: 'maintenancePersonHtml2',
- width: '30%',
- height: 140,
- region: 'north',
- layout: 'form',
- bodyStyle: 'background:#121E34;',
- defaults: {
- border: false
- }
- // items: [childPanel2]
- });
- var piebar3 = Ext.create('Ext.panel.Panel', {
- id: 'maintenancePersonHtml3',
- width: '50%',
- height: 140,
- region: 'north',
- layout: 'form',
- defaults: {
- border: false
- }
- });
- panel1 = Ext.create('Ext.panel.Panel', {
- width: '100%',
- id: 'MaintenancePersonPiebar',
- layout: 'border',
- items: [
- piebar, MaintenancePersonPanel
- ],
- });
- var piebar4 = Ext.create('Ext.panel.Panel', {
- id: 'maintenancePersonHtml4',
- width: '30%',
- region: 'west',
- layout: 'border',
- bodyStyle: 'background:#121E34;border-radius:20px;padding:10px;',
- padding: 10,
- items: [
- piebar2, MaintenancePersonPanel2
- ]
- });
- var piebar5 = Ext.create('Ext.panel.Panel', {
- id: 'maintenancePersonHtml5',
- width: '50%',
- region: 'center',
- layout: 'border',
- bodyStyle: 'padding:10px;',
- padding: 10,
- items: [
- piebar3, MaintenancePersonPanel3
- ]
- });
- var piebar6 = Ext.create('Ext.panel.Panel', {
- id: 'maintenancePersonHtml6',
- width: '20%',
- region: 'east',
- layout: 'form',
- defaults: {
- border: false
- },
- items: [childPanel6]
- });
- panel2 = Ext.create('Ext.panel.Panel', {
- width: '100%',
- id: 'MaintenancePersonPiebar2',
- layout: 'border',
- items: [
- piebar4, piebar5, piebar6
- ],
- });
- Ext.create('Ext.tab.Panel', {
- width: '100%',
- id: 'MaintenancePersonTab',
- activeTab: 0,
- items: [
- {
- itemId: 'person',
- title: '人员列表',
- items: [panel1]
- },
- {
- itemId: 'team',
- title: '班组详情',
- items: [panel2]
- }
- ],
- listeners: {
- 'tabchange': function (t, n) {
- var item = n.itemId;
- if (item == 'team') {
- if (document.getElementById('div26_id_maintenancePersonPanel3') == undefined)
- childPanel2();
- if (document.getElementById('div26_id_maintenancePersonHtml3Panel3') == undefined)
- childPanel3_fun();
- myStore2.reload();
- }
- }
- },
- renderTo: Ext.getBody()
- });
- myStore.reload();
- mystore2_fun(0);
- childPanel1();
- $(window).resize(function () {
- body_resize();
- body_resize1();
- });
- body_resize1();
- body_resize();
- });
|