| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092 | /** * pzb.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 V_LOGINNAME='',V_PASSWORD='';var menuidx = '';var mouseon;var editMaintenancePresentation;var examineStatus;var mouseoff;var menu_click;var modifywin;var examin_win;var sm = Ext.create('Ext.selection.CheckboxModel');var sm1 = Ext.create('Ext.selection.CheckboxModel');Ext.define('CheckRecord2',{	extend: 'Ext.data.Model',	fields: [		{name:'id',  type:'string'},		{name:'xh',  type:'int'},		{name:'username',  type:'string'},		{name:'company_name',  type:'string'},		{name:'bjhm',  type:'string'},		{name:'bjxh',  type:'string'},		{name:'zed',  type:'string'},		{name:'krq',  type:'string'},		{name:'jrq',  type:'string'},		{name:'pzlb',  type:'string'},		{name:'pzlb_name',  type:'string'},		{name:'zq',  type:'string'},		{name:'sbtype',  type:'string'},		{name:'sbtype_name_list',  type:'string'},		{name:'zrs',  type:'int'},		{name:'jrsj',  type:'int'},		{name:'cssj',  type:'int'},		{name:'jrjj',  type:'int'},		{name:'gdwdtbjsl',  type:'int'},	]});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;	if((company_code!=null)&&(company_code!='null')&&(company_code.length>0))		queryJson.company_code = company_code;					myStore = Ext.create('Ext.data.Store', {	    model: 'CheckRecord2',	    pageSize: countPerPage, 	    proxy: {	        type: 'ajax',	        actionMethods: {                create : 'POST',                read   : 'POST', // by default GET                update : 'POST',                destroy: 'POST'	        },	        url: baseUrl+'iot/pzb/getList',	        reader: {	            type: 'json',	            root: 'RESULT',	            totalProperty: 'totalCount'	        },	        extraParams:{	        	queryJson:Ext.JSON.encode(queryJson)	        }	    },	    remoteSort: true	});		Ext.define('CompanyUser',{		extend:'Ext.data.Model',		fields: [			{name:'company_name',  type:'string'},			{name:'id',type:'int'}		]	});		var getCompanyUser = Ext.create('Ext.data.Store',{		model: 'CompanyUser',	    proxy: {	        type: 'ajax',	        actionMethods: {                create : 'POST',                read   : 'POST', // by default GET                update : 'POST',                destroy: 'POST'	        },	        url: baseUrl+'iot/pzb/getCompanyUser',	        reader: {	            type: 'json',	            root: 'RESULT',	            totalProperty: 'totalCount'	        },	        extraParams:{	        	queryJson:Ext.JSON.encode(queryJson)	        }	    }	});		var companyxx = function(id) {		var query = new Object();			// query.V_LOGINNAME = $("#V_LOGINNAME").val();			query.id = id;//			pieMask.show();		$.ajax({	        type:'POST',	        url: baseUrl+"iot/pzb/getxx",	        data: {	        	queryJson : Ext.JSON.encode(query)	    	 },	        success: function(result){	            var json = eval('(' + result + ')');	            if(json.action=='getxx'){	                ConfirmStore = json.RESULT;	                var zed = ConfirmStore[0].zed;	                var bjhm = ConfirmStore[0].bjhm;	                var bjxh = ConfirmStore[0].bjxh;//	                Ext.getCmp('fm_zed').setValue(bjxh);	                $("#bjxh").val(bjxh);	                $("#bjhm").val(bjhm);	                $("#zed").val(zed);	                var a=document.getElementById('zed').value;			    	alert(a);	       	            }	            	        } 	    });			}		var states1 = Ext.create('Ext.data.Store', {	    fields: ['pzlb', 'name'],	    data : [	    	{"pzlb":"天", "name":"天"},	        {"pzlb":"月", "name":"月"},	        {"pzlb":"年", "name":"年"},	    ]	});		var states = Ext.create('Ext.data.Store', {	    fields: ['status', 'name'],	    data : [	    	{"status":"0", "name":"天"},	        {"status":"1", "name":"月"},	        {"status":"2", "name":"年"},	    ]	});	//	var clear_append_form1 = function (){////		Ext.getCmp('fa_username').setValue("");//		Ext.getCmp('fa_company_name').setValue("");//		Ext.getCmp('fa_pzlb').setValue("");//		Ext.getCmp('fa_lbsl').setValue("");////		Ext.getCmp('fa_bjxh').setValue("");////		Ext.getCmp('fa_bjhm').setValue("");//		Ext.getCmp('fa_zed').setValue("");//		Ext.getCmp('fa_krq').setValue("");//		Ext.getCmp('fa_jrq').setValue("");//		Ext.getCmp('fa_sbtype').setValue("");//		Ext.getCmp('pzbListPageToolbar').moveFirst();//	}//	//	var goodsNameCombo = new Ext.form.TextField({//		id: "fa_bjxh",//		labelWidth: 72,////		bodyPadding: 15,//		width : '75%',//		maxLength:20,//		maxLengthText:'长度不得超出{0}',//    	xtype: 'textfield',//    	fieldLabel: '显号',//    	name: 'bjxh',//    	value:document.getElementById('bjxh').value,////		readOnly:'true'//	});//		//	var AppendForm1 = Ext.create('Ext.form.Panel', {//		id: 'InspectorsAppendForm1',//		labelWidth: 55,//		url: baseUrl+'iot/pzb/append',//		defaultType: 'textfield',//		bodyPadding: 15,//		items: [//		{//			fieldLabel:'单位',//			id:'fa_company_name',//			name:'company_name',//			xtype:'combo',//			store:getCompanyUser,//			displayField : 'company_name',  //	        valueField : 'id',//	        editable : false,//	        anchor:'75%',//		},{//			fieldLabel:'额度',//			id: 'fa_zed',//			name:'zed',//			maxLength:20,//			maxLengthText:'长度不得超出{0}',//			anchor:'75%',//			value:document.getElementById('zed').value//		},{                //	        fieldLabel:'周期',//			id:'fa_pzlb',//			name:'pzlb',//			xtype:'combo',//			store:states,//			displayField : 'name',  //	        valueField : 'status',//	        editable : false,//	        anchor:'75%',//		},{//			fieldLabel:'周期次数',//			id: 'fa_lbsl',//			name:'lbsl',//			maxLength:20,//			maxLengthText:'长度不得超出{0}',//			anchor:'75%',//		},{//        	xtype:'datefield',//            fieldLabel:"开始日期",//            minValue:data,//            minText:"当前日期选择应大于当天日期",//            format:"Y-m-d",//            id: 'fa_krq',//            name:"krq",//            editable:false,//只读约束//            anchor:'80%'//		},{//			xtype:'datefield',//            fieldLabel:"结束日期",//            minValue:data,//                   // '07/07/2017',//            minText:"当前日期选择应大于当天日期",//            format:"Y-m-d",//            id: 'fa_jrq',//            name:"jrq",//            editable:false,//只读约束//            anchor:'80%'//		},{//  			xtype: 'checkboxgroup',//            fieldLabel: '报警类型',//            id:"fa_sbtype",//            listeners:{//                change:function(gp,nv,ov,eOpts){//                	var i=0;//                    if(nv.all && !ov.all){ //                    	Ext.getCmp('fa_all_checkbox').setValue(true);//                    	Ext.getCmp('fa_monday_checkbox').setValue(true);//                    	Ext.getCmp('fa_tuesday_checkbox').setValue(true);//                    	Ext.getCmp('fa_wednesday_checkbox').setValue(true);//                    	Ext.getCmp('fa_thursday_checkbox').setValue(true);//                    	Ext.getCmp('fa_friday_checkbox').setValue(true);//                    	Ext.getCmp('fa_saturday_checkbox').setValue(true);//                    	Ext.getCmp('fa_sunday_checkbox').setValue(true);//                    	return true;//                    }//                    if(ov.all && !nv.all && nv.monday && nv.tuesday && nv.wednesday && nv.thursday && nv.friday && nv.saturday && nv.sunday){//                    	Ext.getCmp('fa_all_checkbox').setValue(false);//                    	Ext.getCmp('fa_monday_checkbox').setValue(false);//                    	Ext.getCmp('fa_tuesday_checkbox').setValue(false);//                    	Ext.getCmp('fa_wednesday_checkbox').setValue(false);//                    	Ext.getCmp('fa_thursday_checkbox').setValue(false);//                    	Ext.getCmp('fa_friday_checkbox').setValue(false);//                    	Ext.getCmp('fa_saturday_checkbox').setValue(false);//                    	Ext.getCmp('fa_sunday_checkbox').setValue(false);//                    	return true;//                    }//                    if(nv.monday && nv.tuesday && nv.wednesday && nv.thursday && nv.friday && nv.saturday && nv.sunday){//                    	 Ext.getCmp('fa_all_checkbox').setValue(true);//                    	 return true;//                    }else{//                    	 Ext.getCmp('fa_all_checkbox').setValue(false);//                    	 return true;//                    }//                }//            },//            columns: 3,//            items: [//            	{boxLabel: '全选', name: 'all',inputValue:"0",id:"fa_all_checkbox"},//                {boxLabel: '火警', name: 'monday',inputValue:"1",id:"fa_monday_checkbox"},//                {boxLabel: '消防水', name: 'tuesday',inputValue:"2",id:"fa_tuesday_checkbox"},//                {boxLabel: '烟感', name: 'wednesday',inputValue:"3",id:"fa_wednesday_checkbox"},//                {boxLabel: '液位', name: 'thursday',inputValue:"5",id:"fa_thursday_checkbox"},//                {boxLabel: 'RTU', name: 'friday',inputValue:"6",id:"fa_friday_checkbox"},//                {boxLabel: '电气火灾', name: 'saturday',inputValue:"7",id:"fa_saturday_checkbox"},//                {boxLabel: '离线', name: 'sunday',inputValue:"8",id:"fa_sunday_checkbox"}//        ]},{//			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.id = Ext.getCmp('fa_company_name').getValue();//		        	query.pzlb = Ext.getCmp('fa_pzlb').getValue();//		        	query.lbsl = Ext.getCmp('fa_lbsl').getValue();//		        	query.zed = Ext.getCmp('fa_zed').getValue();//		        	query.krq = Ext.util.Format.date(Ext.getCmp('fa_krq').getValue(), 'Y-m-d');//					query.jrq = Ext.util.Format.date(Ext.getCmp('fa_jrq').getValue(), 'Y-m-d');//					var sbtypeValue = Ext.getCmp('fa_sbtype').getChecked();//			        var fa_sbtype1='';//			        	Ext.Array.each(sbtypeValue, function(item){//			        		fa_sbtype1 +=item.inputValue+',';//			        	});//			        query.sbtype = fa_sbtype1;//		        	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.result.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: 400,//		    width: 450,//		    modal: true,//		    layout: 'fit',//		    items:  AppendForm1,//		    closeAction: 'hide'//		}).show();//	}	//	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.username+' 语音报警?',function(btn){//				if(btn=='yes'){////					$.ajax({//			             type:'POST',//			             url: baseUrl+"iot/pzb/del",//			             data: {//			              queryJson : jsonstr//			            //			           },//			           success: function(result){//			             //			             var json = eval('(' + result + ')');//			                 if(json.action=='deletePzb'){//			                  //			                  if(json.success==true){//			                       Ext.Msg.alert('操作成功', json.MSG , function(btn,txt){//			                	      Ext.getCmp('pzbListPanel').getStore().reload();//			                	      $("#pzb_sz_div1").val('');//			                       }); //			                	 }else{//			                		 Ext.Msg.alert('操作失败', json.MSG , function(btn,txt){//				                	      Ext.getCmp('pzbListPanel').getStore().reload();//				                	      $("#pzb_sz_div1").val('');////				                      }); //			                	 }//			                 }//			             //			            }//			     });//				}//			},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/pzb/del",//				             data: {//				              queryJson : jsonstr//				            //				           },//				           success: function(result){//				             //				             var json = eval('(' + result + ')');//				                 if(json.action=='deletePzb'){//				                	 if(json.success==true){//					                       Ext.Msg.alert('操作成功', json.MSG , function(btn,txt){//					                	      Ext.getCmp('pzbListPanel').getStore().reload();//					                       }); //					                	 }else{//					                		 Ext.Msg.alert('操作失败', json.MSG , function(btn,txt){//						                	      Ext.getCmp('pzbListPanel').getStore().reload();//						                      }); //					                	 } //				                 }//				             //				            }//				     });//					//					}//				},this);//			}else{//			Ext.Msg.alert('请先选择','至少选择一条记录,再点击删除');//		}//		}//	}				//	var clear_modify_form = function (){//		Ext.getCmp('fm_id').setValue("");//		Ext.getCmp('fm_company_name').setValue("");////		Ext.getCmp('fm_bjxh').setValue("");////		Ext.getCmp('fm_bjhm').setValue("");//		Ext.getCmp('fm_pzlb').setValue("");//		Ext.getCmp('fm_lbsl').setValue("");//		Ext.getCmp('fm_zed').setValue("");//		Ext.getCmp('fm_krq').setValue("");//		Ext.getCmp('fm_sbtype').setValue("");//		Ext.getCmp('pzbListPageToolbar').moveFirst();//	}	//	var ModifyForm = Ext.create('Ext.form.Panel', {//		id: 'InspectorsEditForm',//		labelWidth: 55,//		url: baseUrl+'iot/pzb/update',//		defaultType: 'textfield',//		bodyPadding: 15,//		items: [{//				fieldLabel:'单位名称',//				id: 'fm_company_name',//				name:'company_name',//				maxLength:20,//				maxLengthText:'长度不得超出{0}',//				anchor:'75%',//				readOnly:'true'//			},{//				fieldLabel:'额度',//				id: 'fm_zed',//				name:'zed',//				maxLength:20,//				maxLengthText:'长度不得超出{0}',//				anchor:'75%'//			},{                //		        fieldLabel:'周期',//				id:'fm_pzlb',//				name:'pzlb',//				xtype:'combo',//				store:states1,//				displayField : 'name',  //		        valueField : 'pzlb',//		        editable : false,//		        anchor:'75%',//			},{//				fieldLabel:'周期次数',//				id: 'fm_lbsl',//				name:'lbsl',//				maxLength:20,//				maxLengthText:'长度不得超出{0}',//				anchor:'75%',//			},{//	        	xtype:'datefield',//	            fieldLabel:"开始日期",//	            minValue:data,//	            minText:"当前日期选择应大于当天日期",//	            format:"Y-m-d",//	            id: 'fm_krq',//	            name:"krq",//	            editable:false,//只读约束//	            anchor:'80%'//			},{//				xtype:'datefield',//	            fieldLabel:"结束日期",//	            minValue:data,//	                   // '07/07/2017',//	            minText:"当前日期选择应大于当天日期",//	            format:"Y-m-d",//	            id: 'fm_jrq',//	            name:"jrq",//	            editable:false,//只读约束//	            anchor:'80%'//			},{//	  			xtype: 'checkboxgroup',//	            fieldLabel: '报警类型',//	            id:"fm_sbtype",//	            columns: 3,//	            items: [//	               {boxLabel: '火警', name: 'monday',inputValue:"1",id:"fm_monday"},//	               {boxLabel: '消防水', name: 'tuesday',inputValue:"2",id:"fm_tuesday"},//	               {boxLabel: '烟感', name: 'wednesday',inputValue:"3",id:"fm_wednesday"},//	               {boxLabel: '液位', name: 'thursday',inputValue:"5",id:"fm_thursday"},//	               {boxLabel: 'RTU', name: 'friday',inputValue:"6",id:"fm_friday"},//	               {boxLabel: '电气火灾', name: 'saturday',inputValue:"7",id:"fm_saturday"},//	               {boxLabel: '离线', name: 'sunday',inputValue:"8",id:"fm_sunday"}//	        ]},{//				   id: 'fm_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 query = new Object();//			           	query.id = Ext.getCmp('fm_id').getValue();//			           	if(Ext.getCmp('fm_pzlb').getValue()=='天'){//			        		query.pzlb = 0;//			           	}else if(Ext.getCmp('fm_pzlb').getValue()=='月'){//			           		query.pzlb = 1;//			           	}else if(Ext.getCmp('fm_pzlb').getValue()=='年'){//			           		query.pzlb = 2;//			           	}//			        	query.lbsl = Ext.getCmp('fm_lbsl').getValue();//			        	query.zed = Ext.getCmp('fm_zed').getValue();//			        	query.krq = Ext.util.Format.date(Ext.getCmp('fm_krq').getValue(), 'Y-m-d');//						query.jrq = Ext.util.Format.date(Ext.getCmp('fm_jrq').getValue(), 'Y-m-d');//						var sbtypeValue = Ext.getCmp('fm_sbtype').getChecked();//				        var fa_sbtype1='';//				        	Ext.Array.each(sbtypeValue, function(item){//				        		fa_sbtype1 +=item.inputValue+',';//				        	});//				        query.sbtype = fa_sbtype1;//			           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: 450,//		    width: 450,//		    modal: true,//		    layout: 'fit',//		    items:  ModifyForm,//		    closeAction: 'hide'//		}).show();//	}	//	var chk_sm = function() {//		  if(sm.getCount()==1){//		   modifywin();//		   var selected = sm.getSelection();//		   Ext.getCmp('fm_id').setValue(selected[0].raw.id);//		   Ext.getCmp('fm_company_name').setValue(selected[0].raw.company_name);////		   Ext.getCmp('fm_bjxh').setValue(selected[0].raw.bjxh);////		   Ext.getCmp('fm_bjhm').setValue(selected[0].raw.bjhm);//		   Ext.getCmp('fm_pzlb').setValue(selected[0].raw.pzlb_name);//		   Ext.getCmp('fm_lbsl').setValue(selected[0].raw.lbsl);//		   Ext.getCmp('fm_zed').setValue(selected[0].raw.zed);//		   Ext.getCmp('fm_krq').setValue(selected[0].raw.krq);//		   Ext.getCmp('fm_jrq').setValue(selected[0].raw.jrq);//		   var a = selected[0].raw.sbtype;//			var arr = a.split(",");//			for(var i = 0 ;i < arr.length;i++) {//			    switch(arr[i]) {//			    case "1"://			     Ext.getCmp('fm_monday').setValue(true);//			     break; //			    case "2"://			     Ext.getCmp('fm_tuesday').setValue(true);//			        break;//			    case "3"://				 Ext.getCmp('fm_wednesday').setValue(true);//				    break;//			    case "5"://			     Ext.getCmp('fm_thursday').setValue(true);//			        break;//			    case "6"://				 Ext.getCmp('fm_friday').setValue(true);//				    break;//			    case "7"://				 Ext.getCmp('fm_saturday').setValue(true);//					break;//			    case "8"://				 Ext.getCmp('fm_sunday').setValue(true);//				    break;//			    }//			 }//		  }else{//		   Ext.Msg.alert('请先选择','请先选择一条记录,再点击修改');//		  }//		 }					var data =Ext.Date.format(new Date(), 'm/d/Y');		var show_page = function(){		var company_name  = document.getElementById('pzb_title2_input').value;		var bjhm = document.getElementById('pzb_title3_input1').value;		var bjxh = document.getElementById('pzb_title3_input5').value;		var query = new Object();		if(company_name.length>0){			query.company_name = company_name;			$("#company_name").val(company_name);		}		if(bjhm.length>0){			query.bjhm = bjhm;			$("#bjhm").val(bjhm);		}		if(bjxh.length>0){			query.bjxh = bjxh;			$("#bjxh").val(bjxh);		}//		query.V_LOGINNAME = V_LOGINNAME;//		query.V_PASSWORD =  V_PASSWORD;		var jsonstr = Ext.JSON.encode(query);    	myStore.getProxy().extraParams = {    		queryJson : jsonstr    	};    	Ext.getCmp('pzbListPageToolbar').moveFirst();	}		var reset1 = function(){		document.getElementById('pzb_title2_input').value = '';		document.getElementById('pzb_title3_input1').value = '';		document.getElementById('pzb_title3_input5').value = '';		$("#company_name").val('');		$("#bjhm").val('');		$("#bjxh").val('');		show_page();	}		mouseon = function(obj){		var id = obj.id;		$("#"+id).removeClass(id);		$("#"+id).addClass(id+'_on');	}		 mouseoff = function(obj){		var mid = "pzb_";		for(var i=1;i<6;i++){			var id = "pzb_title"+i+"_div";//			alert(id);			$("#"+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');		}	}		 menu_click = function(obj){		var id = obj.id;		if(id=='pzb_title1_div'){			menuidx = 'm1';			show_page();		}		else if(id=='pzb_title2_div'){			menuidx = 'm2';			reset1();		}//		else if(id=='pzb_title3_div'){//			menuidx = 'm3';////			del_sm();//		}//		else if(id=='pzb_title4_div'){//			menuidx = 'm4';//			appendwin1();////		}//		else if(id=='pzb_title5_div'){//			menuidx = 'm5';////			chk_sm();//		}	}	 	 var maintenancedevice = function(){			var maintenance_look_device = document.getElementById('inspectorsCheck_look_device');			var img = document.createElement('img');			img.width=400;			img.height=400;			img.src = baseUrl+ConfirmStore[0].picture_route;//			img.src = ConfirmStore[0].picture_route;			img.setAttribute('class','maintenance_look_device_img');			maintenance_look_device.appendChild(img);			var div4 = document.createElement('div');			div4.style.textAlign='center';			div4.innerHTML=ConfirmStore[0].remarks;			maintenance_look_device.appendChild(div4);		}	 	 	 var piedarHtml2 = function() {		 		var date=new Date; 		var dates=Ext.util.Format.date(date, 'Y-m-d'); 		var preDate = new Date(date.getTime() - 24*60*60*1000); 		var dates2=Ext.util.Format.date(preDate, 'Y-m-d'); 		var maintenanceCheckHtml = document.getElementById('inspectorsCheckHtml'); 		 		var divhiddle = document.createElement('div');	    divhiddle.id='pzd_div_1';	    divhiddle.setAttribute('class','pzdHandleHtml3DivHiddle');	    maintenanceCheckHtml.appendChild(divhiddle); 		 		var title = document.createElement('div'); 		title.setAttribute('class','pzdTitle'); 		title.innerHTML='综合信息'; 		maintenanceCheckHtml.appendChild(title); 		 		 		var title2 = document.createElement('div'); 		title2.setAttribute('class','pzb_title2_div_font'); 		title2.innerHTML='单位名称'; 		maintenanceCheckHtml.appendChild(title2); 		var input = document.createElement('input'); 		input.setAttribute('class','pzb_input_class'); 		input.setAttribute('id','pzb_title2_input'); 		input.setAttribute('type','text'); 		input.setAttribute('value',''); 		maintenanceCheckHtml.appendChild(input); 		 		var title3 = document.createElement('div'); 		title3.setAttribute('class','pzb_title3_div_font'); 		title3.innerHTML='责任人手机号'; 		maintenanceCheckHtml.appendChild(title3); 		var input1 = document.createElement('input'); 		input1.setAttribute('class','pzb_input1_class'); 		input1.setAttribute('id','pzb_title3_input1'); 		input1.setAttribute('type','text'); 		input1.setAttribute('value',''); 		maintenanceCheckHtml.appendChild(input1); 		 		var title28 = document.createElement('div'); 		title28.setAttribute('class','pzb_title28_div'); 		title28.innerHTML='显号'; 		maintenanceCheckHtml.appendChild(title28); 		 		 		var select = document.createElement('select');		   select.setAttribute('class','pzb_input5_class');		   select.setAttribute('id','pzb_title3_input5');		   maintenanceCheckHtml.appendChild(select);		   var option2 = document.createElement('option');		   option2.innerHTML='所有';		   option2.setAttribute('value','0');		   select.appendChild(option2);		   for(var i=0;i<ConfirmStore1.length;i++){			   var option3 = document.createElement('option');			   option3.innerHTML=ConfirmStore1[i].xh;			   option3.setAttribute('value',ConfirmStore1[i].id);			   select.appendChild(option3); 		   } 		 		// 		var input2 = document.createElement('input');// 		input2.setAttribute('class','pzb_input5_class');// 		input2.setAttribute('id','pzb_title3_input5');// 		input2.setAttribute('type','text');// 		input2.setAttribute('value','');// 		maintenanceCheckHtml.appendChild(input2); 		 		var title4 = document.createElement('div'); 		title4.setAttribute('class','pzb_title1_div'); 		title4.setAttribute('id','pzb_title1_div'); 		title4.setAttribute('onmouseover',"mouseon(this)"); 		title4.setAttribute('onmouseout',"mouseoff(this)"); 		title4.setAttribute('onclick',"menu_click(this)"); 		maintenanceCheckHtml.appendChild(title4);	 		var title5 = document.createElement('div'); 		title5.setAttribute('class','pzb_title2_div'); 		title5.setAttribute('id','pzb_title2_div'); 		title5.setAttribute('onmouseover',"mouseon(this)"); 		title5.setAttribute('onmouseout',"mouseoff(this)"); 		title5.setAttribute('onclick',"menu_click(this)"); 		maintenanceCheckHtml.appendChild(title5); 		// 		var title6 = document.createElement('div');// 		title6.setAttribute('class','pzb_title3_div');// 		title6.setAttribute('id','pzb_title3_div');// 		title6.setAttribute('onmouseover',"mouseon(this)");// 		title6.setAttribute('onmouseout',"mouseoff(this)");// 		title6.setAttribute('onclick',"menu_click(this)");// 		maintenanceCheckHtml.appendChild(title6); 		// 		var title66 = document.createElement('div');//		title66.setAttribute('class','pzb_title4_div');//		title66.setAttribute('id','pzb_title4_div');//		title66.setAttribute('onmouseover',"mouseon(this)");//		title66.setAttribute('onmouseout',"mouseoff(this)");//		title66.setAttribute('onclick',"menu_click(this)");//		maintenanceCheckHtml.appendChild(title66);		//		var title88 = document.createElement('div');//		title88.setAttribute('class','pzb_title5_div');//		title88.setAttribute('id','pzb_title5_div');//		title88.setAttribute('onmouseover',"mouseon(this)");//		title88.setAttribute('onmouseout',"mouseoff(this)");//		title88.setAttribute('onclick',"menu_click(this)");//		maintenanceCheckHtml.appendChild(title88); 				 		var title10 = document.createElement('div'); 		title10.setAttribute('class','pzb_title20_div'); 		maintenanceCheckHtml.appendChild(title10); 		var title11 = document.createElement('div'); 		title11.setAttribute('class','pzb_title11_div'); 		maintenanceCheckHtml.appendChild(title11); 		var title12 = document.createElement('div'); 		title12.setAttribute('class','pzb_title12_div'); 		maintenanceCheckHtml.appendChild(title12); 		var title13 = document.createElement('div'); 		title13.setAttribute('class','pzb_title13_div'); 		maintenanceCheckHtml.appendChild(title13); 		 		 		 		var title14 = document.createElement('div'); 		title14.setAttribute('id','pzb_sz_div1'); 		title14.setAttribute('class','companyxx_title14_div'); 		title14.innerHTML=""; 		title14.innerHTML=ConfirmStore[0].dtbjzs; 		maintenanceCheckHtml.appendChild(title14); 		// 		var szqc2 = document.getElementById('pzb_sz_div2'); 		var title15 = document.createElement('div'); 		title15.setAttribute('id','pzb_sz_div2'); 		title15.setAttribute('class','companyxx_title15_div'); 		title15.innerHTML=ConfirmStore[0].yebzdwzs; 		maintenanceCheckHtml.appendChild(title15); 		// 		var szqc3 = document.getElementById('pzb_sz_div3'); 		var title16 = document.createElement('div'); 		title16.setAttribute('id','pzb_sz_div3'); 		title16.setAttribute('class','companyxx_title16_div'); 		title16.innerHTML=ConfirmStore[0].ktdwzs; 		maintenanceCheckHtml.appendChild(title16); 		// 		var szqc4 = document.getElementById('pzb_sz_div4'); 		var title17 = document.createElement('div'); 		title17.setAttribute('id','pzb_sz_div4'); 		title17.setAttribute('class','companyxx_title17_div'); 		title17.innerHTML=ConfirmStore[0].yhzs; 		maintenanceCheckHtml.appendChild(title17);	 }	 	 var piedarHtml_fun = function(){	 		var query = new Object();	 		// query.V_LOGINNAME = $("#V_LOGINNAME").val();	 		$.ajax({	 			type:'POST',	 			url: baseUrl+"iot/pzb/getXhList",		        data: {		        queryJson : Ext.JSON.encode(query)		        },		        success: function(result){		        	var json = eval('(' + result + ')');		        	if(json.action=='getXhList'){		        		ConfirmStore1 = json.RESULT;//		        		if(document.getElementById('pzd_div_1')==undefined)		        			piedarHtml2();		              }		          } 		      });		  }	 		var piedarHtml = function() {			var query = new Object();				// query.V_LOGINNAME = $("#V_LOGINNAME").val();							$.ajax({		        type:'POST',		        url: baseUrl+"iot/pzb/getpzbsl",		        data: {		        	queryJson : Ext.JSON.encode(query)		    	 },		        success: function(result){		            var json = eval('(' + result + ')');		            if(json.action=='getPzbSl'){		                ConfirmStore = json.RESULT;		                piedarHtml_fun();//		                piedarHtml2();		       		            }		        } 		    });					}		var pzbListPanel=Ext.create('Ext.grid.Panel', {		header :{			height:0,			border:'0px solid #000000'		},	    id: 'pzbListPanel',	    store: myStore,	    selModel: sm,	    columns: [	    	 { header: 'ID',  dataIndex: 'id',hidden:true, menuDisabled:true },	    	 { header: '周期',  dataIndex: 'pzlb',hidden:true, menuDisabled:true },	    	 { header: '周期',  dataIndex: 'pzlb_name',hidden:true, menuDisabled:true },	    	 { header: '数量',  dataIndex: 'lbsl',hidden:true, menuDisabled:true },	    	 { header: '类型ID',  dataIndex: 'sbtype',hidden:true, menuDisabled:true },	    	 { header: '用户名',  dataIndex: 'username',hidden:true, menuDisabled:true },	    	 { header: '序号',  dataIndex: 'xh', width:76, menuDisabled:true },		     { header: '单位名称', dataIndex: 'company_name', width:180,align:'center', menuDisabled:true },		     { header: '责任人手机号', dataIndex: 'bjhm', width:200,align:'center', menuDisabled:true },		     { header: '显号', dataIndex: 'bjxh', width:200,align:'center', menuDisabled:true },		     { header: '余额(次)', dataIndex: 'zed', width:109, align:'center', menuDisabled:true },		     { header: '个/时间', dataIndex: 'zq',width:122, align:'center', menuDisabled:true },		     { header: '当天报警数量', dataIndex: 'gdwdtbjsl', width:150, align:'center', menuDisabled:true },		     { header: '开始日期', dataIndex: 'krq', width:200, align:'center', menuDisabled:true },		     { header: '结束日期', dataIndex: 'jrq', width:200, align:'center', menuDisabled:true },	    ],	    columnLines: true,	    height: maxHeight,	    width: '100%',	    bbar: new Ext.PagingToolbar({              store: myStore,              id:'pzbListPageToolbar',            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:'inspectorsCheckHtml',		width:'100%',		height:250,		region:'north',		layout:'form',		defaults:{              border:false        }         		});	new Ext.create('Ext.panel.Panel',{		width:'100%',		id: 'InspectorsCheckPiebar',		layout:'border',		items:[			piebar,pzbListPanel		],	    renderTo: Ext.getBody()	    	});//	piedarHtml();	myStore.reload();	myStore.addListener('load',function(store,record,opts){		if(document.getElementById('pzd_div_1')==undefined)			piedarHtml();	});				maxHeight =  document.documentElement.clientHeight;	Ext.getCmp('InspectorsCheckPiebar').setHeight(maxHeight);	});
 |