12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718 |
- /**
- * inspectors.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('InspectorsPiebar').setHeight(maxHeight);
- Ext.getCmp('InspectorsPiebar').setWidth(maxWidth);
- }
- var body_resize1 = function () {
- maxHeight = document.documentElement.clientHeight;
- maxHeight -= 34;
- maxWidth = document.documentElement.clientWidth;
- Ext.getCmp('InspectorsPiebar2').setHeight(maxHeight);
- Ext.getCmp('InspectorsPiebar2').setWidth(maxWidth);
- }
- 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 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_Inspectors_team_name').setValue("");
- Ext.getCmp('fa_Inspectors_person_liable_id').setValue("");
- Ext.getCmp('InspectorsListPageToolbar2').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/getList1',
- reader: {
- type: 'json',
- root: 'RESULT',
- totalProperty: 'totalCount'
- },
- extraParams: {
- queryJson: Ext.JSON.encode(queryJson)
- }
- },
- 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('InspectorsListPanel2').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('InspectorsListPanel2').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/getTeamMembersListxj',
- reader: {
- type: 'json',
- root: 'RESULT',
- totalProperty: 'totalCount'
- },
- extraParams: {
- queryJson: Ext.JSON.encode(queryJson)
- }
- },
- remoteSort: true
- });
- myStore1.on('load', function (myStore1, record) {
- for (var i = 0; i < record.length; i++) {
- var records = record[i];
- if (records.get('pd') == 1) {
- Ext.getCmp('InspectorsListPanel3').getSelectionModel().select(records, true);
- }
- };
- });
- 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/getTeamMembersList1xj',
- 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_Inspectors_phone').setValue('');
- });
- return false;
- }
- }
- var AppendForm = Ext.create('Ext.form.Panel', {
- id: 'InspectorsAppendForm',
- labelWidth: 55,
- url: baseUrl + 'iot/inspectorsx/append',
- defaultType: 'textfield',
- bodyPadding: 15,
- items: [{
- fieldLabel: '人员姓名',
- id: 'fa_Inspectors_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_Inspectors_name').setValue('');
- });
- return false;
- }
- }
- }
- }, {
- fieldLabel: '电话号码',
- id: 'fa_Inspectors_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_Inspectors_phone').setValue(e.substring(0, 11));
- e.length == 11 ? public_phone(e) : ''
- }
- }
- }
- }, {
- xtype: 'checkboxgroup',
- fieldLabel: '人员职能',
- id: "fa_Inspectors_inspectiontime",
- columns: 3,
- items: [
- { boxLabel: '维保', name: 'maintenance', inputValue: "1" },
- { boxLabel: '巡检', name: 'inspection', inputValue: "2" },
- { boxLabel: '报修', name: 'event_processing', inputValue: "4" }
- ]
- }, {
- id: 'fa_Inspectors_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_Inspectors_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_Inspectors_name').getValue();
- if (query.name == null || query.name == "") {
- Ext.Msg.alert('系统提示', '人员姓名不能为空!');
- return;
- }
- query.phone = Ext.getCmp('fa_Inspectors_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_Inspectors_queryJson').setValue(jsonstr);
- form.submit({
- method: 'post',
- success: function (form, action) {
- Ext.Msg.alert('操作成功', '已保存', function (btn, txt) {
- Ext.getCmp('InspectorsAppendForm').getForm().reset();
- Ext.getCmp('InspectorsListPageToolbar').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();
- }
- var AppendForm1 = Ext.create('Ext.form.Panel', {
- id: 'InspectorsAppendForm1',
- labelWidth: 55,
- url: baseUrl + 'iot/planteam/append1',
- defaultType: 'textfield',
- bodyPadding: 15,
- items: [{
- fieldLabel: '班组名称',
- id: 'fa_Inspectors_team_name',
- name: 'team_name',
- maxLength: 20,
- maxLengthText: '长度不得超出{0}',
- anchor: '75%'
- }, {
- fieldLabel: '负责人',
- id: 'fa_Inspectors_person_liable_id',
- name: 'person_liable_id',
- xtype: 'combo',
- store: getJobDutiesStore1,
- displayField: 'name',
- valueField: 'rid',
- editable: false,
- anchor: '75%'
- }, {
- id: 'fa_Inspectors_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_Inspectors_team_name').getValue();
- query.person_liable_id = Ext.getCmp('fa_Inspectors_person_liable_id').getValue();
- var jsonstr = Ext.JSON.encode(query);
- Ext.getCmp('fa_Inspectors_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,
- width: 400,
- modal: true,
- layout: 'fit',
- items: AppendForm1,
- closeAction: 'hide'
- }).show();
- }
- var clear_modify_form = function () {
- Ext.getCmp('fm_inspectors_id').setValue("");
- Ext.getCmp('fm_inspectors_queryJson').setValue("");
- Ext.getCmp('fm_inspectors_name').setValue("");
- Ext.getCmp('fm_inspectors_phone').setValue("");
- Ext.getCmp('fm_inspectors_inspectiontime').setValue(false);
- Ext.getCmp('InspectorsListPanel').getStore().reload();
- }
- var ModifyForm = Ext.create('Ext.form.Panel', {
- id: 'InspectorsEditForm',
- labelWidth: 55,
- url: baseUrl + 'iot/inspectorsx/update',
- defaultType: 'textfield',
- bodyPadding: 15,
- items: [{
- fieldLabel: '人员姓名',
- id: 'fm_inspectors_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_Inspectors_name').setValue('');
- });
- return false;
- }
- }
- }
- }, {
- fieldLabel: '电话号码',
- id: 'fm_inspectors_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_Inspectors_phone').setValue(e.substring(0, 11));
- e.length == 11 ? public_phone(e) : ''
- }
- }
- }
- }, {
- xtype: 'checkboxgroup',
- fieldLabel: '人员职能',
- id: "fm_inspectors_inspectiontime",
- columns: 3,
- items: [
- { boxLabel: '维保', name: 'maintenance', inputValue: "1", id: 'inspectors_maintenance' },
- { boxLabel: '巡检', name: 'inspection', inputValue: "2", id: 'inspectors_inspection' },
- { boxLabel: '报修', name: 'event_processing', inputValue: "4", id: 'inspectors_event_processing' }
- ]
- }, {
- id: 'fm_inspectors_id',
- name: 'id',
- hidden: true
- }, {
- id: 'fm_inspectors_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_inspectors_inspectiontime').getChecked();
- var Inspectiontime = 0;
- Ext.Array.each(InspectiontimeValue, function (item) {
- Inspectiontime += parseInt(item.inputValue);
- });
- var query = new Object();
- query.id = Ext.getCmp('fm_inspectors_id').getValue();
- query.name = Ext.getCmp('fm_inspectors_name').getValue();
- if (query.name == null || query.name == "") {
- Ext.Msg.alert('系统提示', '人员姓名不能为空!');
- return;
- }
- query.phone = Ext.getCmp('fm_inspectors_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('fm_inspectors_queryJson').setValue(jsonstr);
- form.submit({
- method: 'post',
- success: function (form, action) {
- Ext.Msg.alert('操作成功', '已修改', function (btn, txt) {
- clear_modify_form();
- });
- },
- failure: function (form, action) {
- Ext.Msg.alert('操作失败', action.Msg, function (btn, txt) {
- clear_modify_form();
- });
- }
- });
- this.up('window').hide();
- }
- }
- }, {
- text: '关闭',
- iconCls: 'cancel_btn',
- handler: function () {
- this.up('window').hide();
- clear_modify_form();
- }
- }]
- });
- 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('inspectors_maintenance').setValue(true);
- break;
- case "2":
- Ext.getCmp('inspectors_inspection').setValue(true);
- break;
- case "4":
- Ext.getCmp('inspectors_event_processing').setValue(true);
- break;
- }
- }
- Ext.getCmp('fm_inspectors_id').setValue(selected[0].raw.id);
- Ext.getCmp('fm_inspectors_name').setValue(selected[0].raw.name);
- Ext.getCmp('fm_inspectors_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('InspectorsListPanel').getStore().reload();
- });
- } else {
- Ext.Msg.alert('操作失败', json.MSG, function (btn, txt) {
- Ext.getCmp('InspectorsListPanel').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') {
- $.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('InspectorsListPanel').getStore().reload();
- });
- } else {
- Ext.Msg.alert('操作失败', json.MSG, function (btn, txt) {
- Ext.getCmp('InspectorsListPanel').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('InspectorsListPanel2').getStore().reload();
- });
- } else {
- Ext.Msg.alert('操作失败', json.MSG, function (btn, txt) {
- Ext.getCmp('InspectorsListPanel2').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('InspectorsListPanel2').getStore().reload();
- });
- } else {
- Ext.Msg.alert('操作失败', json.MSG, function (btn, txt) {
- Ext.getCmp('InspectorsListPanel2').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('inspectors_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('InspectorsListPageToolbar').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('InspectorsListPageToolbar2').moveFirst();
- }
- var reset1 = function () {
- var zn = document.getElementsByName("zhineng");
- for (var i = 0; i < zn.length; i++) {
- zn[i].checked = true;
- }
- document.getElementById('inspectors_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 = "inspectors_";
- for (var i = 1; i < 7; i++) {
- var id = "inspectors_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 = "inspectors_";
- for (var i = 1; i < 5; i++) {
- var id = "inspectors_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 == 'inspectors_title1_div') {
- menuidx = 'm1';
- show_page();
- }
- else if (id == 'inspectors_title2_div') {
- menuidx = 'm2';
- reset1();
- }
- else if (id == 'inspectors_title3_div') {
- menuidx = 'm3';
- exportbtn_click();
- }
- else if (id == 'inspectors_title4_div') {
- menuidx = 'm4';
- del_sm();
- }
- else if (id == 'inspectors_title5_div') {
- menuidx = 'm5';
- appendwin();
- }
- else if (id == 'inspectors_title6_div') {
- menuidx = 'm6';
- chk_sm();
- }
- else if (id == 'inspectors_title11_div') {
- menuidx = 'm11';
- del_sm1();
- }
- else if (id == 'inspectors_title21_div') {
- menuidx = 'm21';
- appendwin1();
- }
- else if (id == 'inspectors_title31_div') {
- menuidx = 'm31';
- Preservation_panel3();
- }
- else if (id == 'inspectors_title41_div') {
- menuidx = 'm41';
- cancel_panel3();
- }
- }
- var Preservation_panel3 = function () {
- var team_name = document.getElementById('inspectors_title211_input').value;
- var person_liable_id = document.getElementById('inspectors_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('InspectorsListPageToolbar3').moveFirst();
- document.getElementById('inspectors_title211_input').value = label1;
- document.getElementById('inspectors_title111_input').value = label2;
- }
- var childPanel1 = function () {
- var maintenancePersonHtml = document.getElementById('InspectorsHtml');
- 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', 'inspectors_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', 'inspectors_title1_div');
- childPanel1_title2.setAttribute('id', 'inspectors_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', 'inspectors_title2_div');
- childPanel1_title3.setAttribute('id', 'inspectors_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', 'inspectors_title3_div');
- childPanel1_title4.setAttribute('id', 'inspectors_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', 'inspectors_title4_div');
- childPanel1_title5.setAttribute('id', 'inspectors_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', 'inspectors_title5_div');
- childPanel1_title6.setAttribute('id', 'inspectors_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', 'inspectors_title6_div');
- childPanel1_title7.setAttribute('id', 'inspectors_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('InspectorsListPageToolbar3').moveFirst();
- }
- // var childPanel2 = function() {
- // var maintenancePersonHtml2 = document.getElementById('InspectorsHtml2');
- // var divhiddle = document.createElement('div');
- // divhiddle.id='div26_id_inspectorsPanel3';
- // divhiddle.setAttribute('class','SpringHandleHtml3DivHiddle');
- // maintenancePersonHtml2.appendChild(divhiddle);
- // var childPanel2_title = document.createElement('div');
- // childPanel2_title.setAttribute('class','maintenancePerson_title211_div');
- // childPanel2_title.innerHTML='班组名称';
- // maintenancePersonHtml2.appendChild(childPanel2_title);
- // var childPanel2_input = document.createElement('input');
- // childPanel2_input.setAttribute('class','maintenancePerson_input211_class');
- // childPanel2_input.setAttribute('id','inspectors_title211_input');
- // childPanel2_input.setAttribute('type','text');
- // childPanel2_input.setAttribute('value','');
- // maintenancePersonHtml2.appendChild(childPanel2_input);
- // var childPanel2_title1 = document.createElement('div');
- // childPanel2_title1.setAttribute('class','maintenancePerson_title111_div');
- // childPanel2_title1.innerHTML='负责人';
- // maintenancePersonHtml2.appendChild(childPanel2_title1);
- // var select = document.createElement('select');
- // select.setAttribute('class','maintenancePerson_input111_class');
- // select.setAttribute('onchange',"changeon1(this)");
- // select.setAttribute('id','inspectors_title111_input');
- // maintenancePersonHtml2.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','inspectors_title11_div');
- // childPanel2_title2.setAttribute('id','inspectors_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','inspectors_title21_div');
- // childPanel2_title3.setAttribute('id','inspectors_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 childPanel2 = function () {
- var maintenancePersonHtml2 = document.getElementById('InspectorsHtml2');
- var divhiddle = document.createElement('div');
- divhiddle.id = 'div26_id_inspectorsPanel3';
- 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', 'inspectors_title11_div');
- childPanel2_title2.setAttribute('id', 'inspectors_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', 'inspectors_title21_div');
- childPanel2_title3.setAttribute('id', 'inspectors_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('InspectorsHtml3');
- var divhiddle = document.createElement('div');
- divhiddle.id = 'div26_id_inspectorsHtml3Panel3';
- 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', 'inspectors_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', 'inspectors_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', 'inspectors_title31_div');
- childPanel2_title2.setAttribute('id', 'inspectors_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', 'inspectors_title41_div');
- childPanel2_title3.setAttribute('id', 'inspectors_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/getTeamMembersList1xj",
- data: {
- queryJson: Ext.JSON.encode(query)
- },
- success: function (result) {
- var json = eval('(' + result + ')');
- if (json.action == 'getTeamMembersList1xj') {
- ConfirmStore = json.RESULT;
- childPanel3();
- }
- }
- });
- }
- var childPanel6 = Ext.create('Ext.Panel', {
- height: maxHeight,
- width: '20%',
- html: '<div></div>'
- });
- // var childPanel2_fun =function(){
- // var query = new Object();
- // query.V_LOGINNAME = $("#V_LOGINNAME").val();
- // $.ajax({
- // type:'POST',
- // url: baseUrl+"iot/inspectorsx/getTeamMembersList1xj",
- // data: {
- // queryJson : Ext.JSON.encode(query)
- // },
- // success: function(result){
- // var json = eval('(' + result + ')');
- // if(json.action=='getTeamMembersList1xj'){
- // ConfirmStore = json.RESULT;
- // childPanel2();
- // }
- // }
- // });
- // }
- // var childPanel3 = Ext.create('Ext.Panel', {
- // height:40,
- // width:'100%',
- // 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>'
- // });
- var MaintenancePersonPanel = Ext.create('Ext.grid.Panel', {
- header: {
- height: 0,
- border: '0px solid #000000'
- },
- id: 'InspectorsListPanel',
- 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: 'InspectorsListPageToolbar',
- 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: 'InspectorsListPanel2',
- 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('InspectorsListPageToolbar3').moveFirst();
- document.getElementById('inspectors_title211_input').value = label;
- document.getElementById('inspectors_title111_input').value = label2;
- // Ext.MessageBox.alert("标题触发了"+label);
- }
- // itemdblclick: function () {
- // Ext.MessageBox.alert("标题离开了");
- // }
- },
- bbar: new Ext.PagingToolbar({
- store: myStore2,
- id: 'InspectorsListPageToolbar2',
- // 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: 'InspectorsListPanel3',
- 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: 'InspectorsListPageToolbar3',
- 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: 'InspectorsHtml',
- width: '100%',
- height: 188,
- region: 'north',
- layout: 'form',
- defaults: {
- border: false
- }
- // items: [childPanel1]
- });
- var piebar2 = Ext.create('Ext.panel.Panel', {
- id: 'InspectorsHtml2',
- width: '30%',
- height: 140,
- bodyStyle: 'background:#121E34;',
- region: 'north',
- layout: 'form',
- defaults: {
- border: false
- }
- // items: [childPanel2]
- });
- var piebar3 = Ext.create('Ext.panel.Panel', {
- id: 'InspectorsHtml3',
- width: '50%',
- height: 140,
- region: 'north',
- layout: 'form',
- defaults: {
- border: false
- },
- // items: [childPanel3]
- });
- panel1 = Ext.create('Ext.panel.Panel', {
- width: '100%',
- id: 'InspectorsPiebar',
- layout: 'border',
- items: [
- piebar, MaintenancePersonPanel
- ],
- });
- var piebar4 = Ext.create('Ext.panel.Panel', {
- id: 'InspectorsHtml4',
- 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: 'InspectorsHtml5',
- width: '50%',
- region: 'center',
- layout: 'border',
- bodyStyle: 'padding:10px;',
- padding: 10,
- items: [
- piebar3, MaintenancePersonPanel3
- ]
- });
- var piebar6 = Ext.create('Ext.panel.Panel', {
- id: 'InspectorsHtml6',
- width: '20%',
- region: 'east',
- layout: 'form',
- defaults: {
- border: false
- },
- items: [childPanel6]
- });
- panel2 = Ext.create('Ext.panel.Panel', {
- width: '100%',
- id: 'InspectorsPiebar2',
- layout: 'border',
- items: [
- piebar4, piebar5, piebar6
- ],
- });
- // panel2 = Ext.create('Ext.panel.Panel',{
- // width:'100%',
- // id: 'InspectorsPiebar2',
- // layout:'border',
- // items:[
- // piebar2,MaintenancePersonPanel2,MaintenancePersonPanel3,piebar3
- // ],
- //
- // });
- Ext.create('Ext.tab.Panel', {
- width: '100%',
- id: 'InspectorsTab',
- 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_inspectorsPanel3') == undefined)
- childPanel2();
- if (document.getElementById('div26_id_inspectorsHtml3Panel3') == 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();
- });
|