| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711 | 
							- /**
 
-  * Area.js 
 
-  * 行政区域划分界面
 
-  * emial: hanzhengyi@chinausky.com
 
-  * create: 2018-12-24
 
-  */
 
- 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 sm = Ext.create('Ext.selection.CheckboxModel');
 
- Ext.define('Area',{
 
- 	extend: 'Ext.data.Model',
 
- 	fields: [
 
- 		{ name:'I_ORDER_IDX',	type:'int' },
 
- 		{ name:'V_AREA_ID',	type:'string' },
 
- 		{ name:'V_AREA_NAME', type:'string' },
 
- 		{ name:'V_PARENT_ID', type:'string' },
 
- 		{ name:'E_LEVEL', type:'string' },
 
- 		{ name:'V_CITYCODE', type:'string' },
 
- 		{ name:'V_ZIPCODE', type:'string' },
 
- 		{ name:'V_MERGERNAME', type:'string' },
 
- 		{ name:'V_PINYIN', type:'string' },
 
- 		{ name:'I_VERSION', type:'int' },
 
- 		{ name:'D_STORETIME', type:'string' }
 
- 	]
 
- });
 
- 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"/>'
 
- 	var countPerPage = 20;
 
- 	var maxHeight = 10000;
 
- 	
 
- 	var chkBoolean = function(flag) {
 
- 		if(flag)
 
- 			return chkIcon;
 
- 		return unchkIcon;
 
- 	}
 
- 	var clear_append_form = function (){
 
- 		Ext.getCmp('fa_V_AREA_ID').setValue("");
 
- 		Ext.getCmp('fa_V_AREA_NAME').setValue("");
 
- 		Ext.getCmp('fa_V_PARENT_ID').setValue("");
 
- 		Ext.getCmp('fa_V_CITYCODE').setValue("");
 
- 		Ext.getCmp('fa_V_ZIPCODE').setValue("");
 
- 		Ext.getCmp('fa_V_MERGERNAME').setValue("");
 
- 		Ext.getCmp('fa_V_PINYIN').setValue("");
 
- 		Ext.getCmp('fa_V_AREA_SHORTNAME').setValue("");
 
- 		Ext.getCmp('fa_E_LEVEL').setValue(0);
 
- 		Ext.getCmp('fa_V_COMMENT').setValue("新增行政区域");
 
- 		Ext.getCmp('AreaListPanel').getStore().reload();
 
- 	}
 
- 	var states2 = Ext.create('Ext.data.Store', {
 
- 	    fields: ['status', 'name'],
 
- 	    data : [
 
- 	    	{"status": "国家", "name":"国家"},
 
- 	    	{"status": "省、直辖市、自治区、特别行政区", "name":"省、直辖市、自治区、特别行政区"},
 
- 	        {"status": "地区、市、自治州、盟", "name":"地区、市、自治州、盟"},
 
- 	        {"status": "县、市辖区、县级市、旗", "name":"县、市辖区、县级市、旗"},
 
- 	        	        
 
- 	    ]
 
- 	});	
 
- 	var myStore = Ext.create('Ext.data.Store', {
 
- 	    model: 'Area',
 
- 	    pageSize: countPerPage, 
 
- 	    proxy: {
 
- 	        type: 'ajax',
 
- 	        url: baseUrl+'iot/area/getList',
 
- 	        reader: {
 
- 	            type: 'json',
 
- 	            root: 'RESULT',
 
- 	            totalProperty: 'totalCount'
 
- 	        }
 
- 	    },
 
- 	    remoteSort: true
 
- 	});
 
- 	
 
- 	var AppendForm = Ext.create('Ext.form.Panel', {
 
- 		id: 'AreaAppendForm',
 
- 		labelWidth: 55,
 
- 		url: baseUrl+'iot/area/append',
 
- 		defaultType: 'textfield',
 
- 		bodyPadding: 15,
 
- 		items: [{
 
- 			fieldLabel:'行政区域ID',
 
- 			id: 'fa_V_AREA_ID',
 
- 			name: 'V_AREA_ID',
 
- 			maxLength: 8,
 
- 			maxLengthText:'长度不得超出{0}',
 
- 			anchor:'50%'
 
- 		},{
 
- 			fieldLabel:'行政区域名称',
 
- 			id: 'fa_V_AREA_NAME',
 
- 			name:'V_AREA_NAME',
 
- 			maxLength:20,
 
- 			maxLengthText:'长度不得超出{0}',
 
- 			anchor:'75%'
 
- 		},{
 
- 			fieldLabel:'上级行政区域ID',
 
- 			id: 'fa_V_PARENT_ID',
 
- 			name: 'V_PARENT_ID',
 
- 			maxLength: 7,
 
- 			maxLengthText:'长度不得超出{0}',
 
- 			anchor:'50%'
 
- 		},{
 
- 			fieldLabel:'电话区号',
 
- 			id: 'fa_V_CITYCODE',
 
- 			name:'V_CITYCODE',
 
- 			maxLength: 12,
 
- 			maxLengthText:'长度不得超出{0}',
 
- 			anchor:'75%'
 
- 		},{
 
- 			fieldLabel:'邮政编码',
 
- 			id: 'fa_V_ZIPCODE',
 
- 			name:'V_ZIPCODE',
 
- 			maxLength: 12,
 
- 			maxLengthText:'长度不得超出{0}',
 
- 			anchor:'75%'
 
- 		},{
 
- 			fieldLabel:'组合名称',
 
- 			id: 'fa_V_MERGERNAME',
 
- 			name:'V_MERGERNAME',
 
- 			maxLength: 30,
 
- 			maxLengthText:'长度不得超出{0}',
 
- 			anchor:'75%'
 
- 		},{
 
- 			fieldLabel:'拼音',
 
- 			id: 'fa_V_PINYIN',
 
- 			name:'V_PINYIN',
 
- 			maxLength: 30,
 
- 			maxLengthText:'长度不得超出{0}',
 
- 			anchor:'75%'
 
- 		},{
 
- 			fieldLabel:'行政区域简称',
 
- 			id: 'fa_V_AREA_SHORTNAME',
 
- 			name:'V_AREA_SHORTNAME',
 
- 			maxLength: 30,
 
- 			maxLengthText:'长度不得超出{0}',
 
- 			anchor:'75%'
 
- 		},{
 
- 			fieldLabel:'行政区域级别',
 
- 			id:'fa_E_LEVEL',
 
- 			name:'E_LEVEL',
 
- 			xtype:'combo',
 
- 			store:states2,
 
- 			displayField : 'name',  
 
- 	        valueField : 'status',
 
- 	        editable : false,
 
- 			maxLength: 30,
 
- 			maxLengthText:'长度不得超出{0}',
 
- 			anchor:'75%'
 
- 		},{
 
- 			fieldLabel:'新增行政区域说明',
 
- 			id: 'fa_V_COMMENT',
 
- 			name:'V_COMMENT',
 
- 			xtype: 'textareafield',
 
- 			maxLength: 250,
 
- 			maxLengthText:'长度不得超出{0}',
 
- 			anchor:'100%',
 
- 			value:'新增行政区域'
 
- 		},{
 
- 			id:'fa_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.V_AREA_ID = Ext.getCmp('fa_V_AREA_ID').getValue();
 
- 		        	query.V_AREA_NAME = Ext.getCmp('fa_V_AREA_NAME').getValue();
 
- 		        	query.V_PARENT_ID = Ext.getCmp('fa_V_PARENT_ID').getValue();
 
- 		        	query.V_CITYCODE = Ext.getCmp('fa_V_CITYCODE').getValue();
 
- 		        	query.V_ZIPCODE = Ext.getCmp('fa_V_ZIPCODE').getValue();
 
- 		        	query.V_MERGERNAME = Ext.getCmp('fa_V_MERGERNAME').getValue();
 
- 		        	query.V_PINYIN = Ext.getCmp('fa_V_PINYIN').getValue();
 
- 		        	query.V_AREA_SHORTNAME = Ext.getCmp('fa_V_AREA_SHORTNAME').getValue();
 
- 		        	if(Ext.getCmp('fa_E_LEVEL').getValue()=='国家'){
 
- 		        		query.E_LEVEL=0;
 
- 		        	}
 
- 		        	if(Ext.getCmp('fa_E_LEVEL').getValue()=='省、直辖市、自治区、特别行政区'){
 
- 		        		query.E_LEVEL=1;
 
- 		        	}
 
- 		        	if(Ext.getCmp('fa_E_LEVEL').getValue()=='地区、市、自治州、盟'){
 
- 		        		query.E_LEVEL=2;
 
- 		        	}
 
- 		        	if(Ext.getCmp('fa_E_LEVEL').getValue()=='县、市辖区、县级市、旗'){
 
- 		        		query.E_LEVEL=3;
 
- 		        	}
 
- 		        	query.V_COMMENT = Ext.getCmp('fa_V_COMMENT').getValue();
 
- 		        	query.UQ_ADMIN_ID = '00000000-000000-000000-000000';
 
- 		        	var jsonstr = Ext.JSON.encode(query);
 
- 		        	Ext.getCmp('fa_queryJson').setValue(jsonstr);
 
- 		            form.submit({
 
- 		            	method:'post',
 
- 		                success: function(form, action) {
 
- 		                   Ext.Msg.alert('操作成功', '新增行政区域已保存', function(btn,txt){
 
- 		                	   clear_append_form();
 
- 		                   });
 
- 		                },
 
- 		                failure: function(form, action) {
 
- 		                   Ext.Msg.alert('操作失败', action.Msg , function(btn,txt){
 
- 		                	   clear_append_form();
 
- 		                   });
 
- 		                }
 
- 		            });
 
- 		        }
 
- 		    }
 
- 		},{
 
- 			text: '关闭',
 
- 			iconCls: 'cancel_btn',
 
- 			handler: function() {
 
- 				this.up('window').hide();
 
- 			}
 
- 		}]
 
- 	});
 
- 	
 
- 	var appendwin = function(){
 
- 		Ext.create('Ext.window.Window', {
 
- 		    title: '新增行政区域',
 
- 		    height: 400,
 
- 		    width: 400,
 
- 		    layout: 'fit',
 
- 		    items:  AppendForm,
 
- 		    closeAction: 'hide'
 
- 		}).show();
 
- 	}
 
- 	
 
- 	var clear_filter_form = function(){
 
- 		Ext.getCmp('ff_V_AREA_NAME').setValue("");
 
- 		Ext.getCmp('ff_V_PARENT_ID').setValue("");
 
- 		Ext.getCmp('ff_V_ZIPCODE').setValue("");
 
- 		Ext.getCmp('ff_V_PINYIN').setValue("");
 
- 		Ext.getCmp('ff_E_LEVEL').setValue(0);
 
- 	}
 
- 	var states3 = Ext.create('Ext.data.Store', {
 
- 	    fields: ['status', 'name'],
 
- 	    data : [
 
- 	    	{"status": "8", "name":"不选"},
 
- 	    	{"status": "国家", "name":"国家"},
 
- 	    	{"status": "省、直辖市、自治区、特别行政区", "name":"省、直辖市、自治区、特别行政区"},
 
- 	        {"status": "地区、市、自治州、盟", "name":"地区、市、自治州、盟"},
 
- 	        {"status": "县、市辖区、县级市、旗", "name":"县、市辖区、县级市、旗"},
 
- 	    ]
 
- 	});	
 
- 		
 
- 	var FilterForm = Ext.create('Ext.form.Panel', {
 
- 		id: 'AreaFilterForm',
 
- 		labelWidth: 55,
 
- 		defaultType: 'textfield',
 
- 		bodyPadding: 15,
 
- 		items: [{
 
- 			fieldLabel:'行政区域名称',
 
- 			id: 'ff_V_AREA_NAME',
 
- 			name:'V_AREA_NAME',
 
- 			maxLength:20,
 
- 			maxLengthText:'长度不得超出{0}',
 
- 			anchor:'75%',
 
- 			value:document.getElementById('myAct').value
 
- 		},{
 
- 			fieldLabel:'上级区域ID',
 
- 			id: 'ff_V_PARENT_ID',
 
- 			name: 'V_PARENT_ID',
 
- 			maxLength: 7,
 
- 			maxLengthText:'长度不得超出{0}',
 
- 			anchor:'75%',
 
- 			value:document.getElementById('loginName').value
 
- 		},{
 
- 			fieldLabel:'邮政编码',
 
- 			id: 'ff_V_ZIPCODE',
 
- 			name: 'V_ZIPCODE',
 
- 			maxLength: 7,
 
- 			maxLengthText:'长度不得超出{0}',
 
- 			anchor:'75%',
 
- 			value:document.getElementById('zipCode').value
 
- 		},{
 
- 			fieldLabel:'拼音',
 
- 			id: 'ff_V_PINYIN',
 
- 			name: 'V_PINYIN',
 
- 			maxLength: 7,
 
- 			maxLengthText:'长度不得超出{0}',
 
- 			anchor:'75%',
 
- 			value:document.getElementById('mergerName').value
 
- 		},{
 
- 			fieldLabel:'行政区域级别',
 
- 			id:'ff_E_LEVEL',
 
- 			name:'E_LEVEL',
 
- 			xtype:'combo',
 
- 			store:states3,
 
- 			displayField : 'name',  
 
- 	        valueField : 'status',
 
- 	        editable : false,
 
- 			maxLength: 30,
 
- 			maxLengthText:'长度不得超出{0}',
 
- 			anchor:'75%',
 
- 			value:document.getElementById('level').value
 
- 		},{
 
- 			id:'ff_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();
 
- 		        	if(Ext.getCmp('ff_V_AREA_NAME').getValue().length>0)
 
- 		        		query.V_AREA_NAME = Ext.getCmp('ff_V_AREA_NAME').getValue();
 
- 		        	if(Ext.getCmp('ff_V_PARENT_ID').getValue().length>0)
 
- 		        		query.V_PARENT_ID = Ext.getCmp('ff_V_PARENT_ID').getValue();
 
- 		        	if(Ext.getCmp('ff_V_ZIPCODE').getValue().length>0)
 
- 		        		query.V_ZIPCODE = Ext.getCmp('ff_V_ZIPCODE').getValue();
 
- 		        	if(Ext.getCmp('ff_V_PINYIN').getValue().length>0)
 
- 		        		query.V_PINYIN = Ext.getCmp('ff_V_PINYIN').getValue();
 
- 		        	if(Ext.getCmp('ff_E_LEVEL').getValue().length>0)
 
- 		        		if(Ext.getCmp('ff_E_LEVEL').getValue()=='国家'){
 
- 			        		query.E_LEVEL=0;
 
- 			        	}
 
- 			        	if(Ext.getCmp('ff_E_LEVEL').getValue()=='省、直辖市、自治区、特别行政区'){
 
- 			        		query.E_LEVEL=1;
 
- 			        	}
 
- 			        	if(Ext.getCmp('ff_E_LEVEL').getValue()=='地区、市、自治州、盟'){
 
- 			        		query.E_LEVEL=2;
 
- 			        	}
 
- 			        	if(Ext.getCmp('ff_E_LEVEL').getValue()=='县、市辖区、县级市、旗'){
 
- 			        		query.E_LEVEL=3;
 
- 			        	}
 
- 		        	var jsonstr = Ext.JSON.encode(query);
 
- 		        	myStore.getProxy().extraParams = {
 
- 		        		queryJson : jsonstr
 
- 		        	};
 
- 		        	Ext.getCmp('AreaListPageToolbar').moveFirst();
 
- 		        	Ext.getCmp('myAct').setValue(query.V_AREA_NAME);
 
- 		        	Ext.getCmp('loginName').setValue(query.V_PARENT_ID);
 
- 		        	Ext.getCmp('zipCode').setValue(query.V_ZIPCODE);
 
- 		        	Ext.getCmp('mergerName').setValue(query.V_PINYIN);
 
- 		        	Ext.getCmp('level').setValue(query.E_LEVEL);
 
- 		        	clear_filter_form();
 
- 		        	this.up('window').hide();
 
- 		        }
 
- 		    }
 
- 		},{
 
- 			text: '关闭',
 
- 			iconCls: 'cancel_btn',
 
- 			handler: function() {
 
- 				this.up('window').hide();
 
- 			}
 
- 		}]
 
- 	});
 
- 	
 
- 	var filterwin = function() {
 
- 		Ext.create('Ext.window.Window',{
 
- 			id: 'AreaFilterWin',
 
- 			title: '行政区域筛选',
 
- 			height: 300,
 
- 			width: 400,
 
- 			layout: 'fit',
 
- 			items: FilterForm,
 
- 			closeAction: 'hide'
 
- 		}).show();
 
- 	}
 
- 	
 
- 	var clear_modify_form = function (){
 
- 		Ext.getCmp('fm_V_AREA_NAME').setValue("");
 
- 		Ext.getCmp('fm_V_PARENT_ID').setValue("");
 
- 		Ext.getCmp('fm_V_CITYCODE').setValue("");
 
- 		Ext.getCmp('fm_V_ZIPCODE').setValue("");
 
- 		Ext.getCmp('fm_V_MERGERNAME').setValue("");
 
- 		Ext.getCmp('fm_V_PINYIN').setValue("");
 
- 		Ext.getCmp('fm_E_LEVEL').setValue(0);
 
- 		Ext.getCmp('fm_V_COMMENT').setValue("修改行政区域");
 
- 		Ext.getCmp('AreaListPanel').getStore().reload();
 
- 	}
 
- 	var ModifyForm = Ext.create('Ext.form.Panel', {
 
- 		id: 'AreaEditForm',
 
- 		labelWidth: 55,
 
- 		url: baseUrl+'iot/area/update',
 
- 		defaultType: 'textfield',
 
- 		bodyPadding: 15,
 
- 		items: [{
 
- 			fieldLabel:'行政区域名称',
 
- 			id: 'fm_V_AREA_NAME',
 
- 			name:'V_AREA_NAME',
 
- 			maxLength:20,
 
- 			maxLengthText:'长度不得超出{0}',
 
- 			anchor:'75%'
 
- 		},{
 
- 			fieldLabel:'上级行政区域ID',
 
- 			id: 'fm_V_PARENT_ID',
 
- 			name: 'V_PARENT_ID',
 
- 			maxLength: 7,
 
- 			maxLengthText:'长度不得超出{0}',
 
- 			anchor:'50%'
 
- 		},{
 
- 			fieldLabel:'电话区号',
 
- 			id: 'fm_V_CITYCODE',
 
- 			name:'V_CITYCODE',
 
- 			maxLength: 12,
 
- 			maxLengthText:'长度不得超出{0}',
 
- 			anchor:'75%'
 
- 		},{
 
- 			fieldLabel:'邮政编码',
 
- 			id: 'fm_V_ZIPCODE',
 
- 			name:'V_ZIPCODE',
 
- 			maxLength: 12,
 
- 			maxLengthText:'长度不得超出{0}',
 
- 			anchor:'75%'
 
- 		},{
 
- 			fieldLabel:'组合名称',
 
- 			id: 'fm_V_MERGERNAME',
 
- 			name:'V_MERGERNAME',
 
- 			maxLength: 30,
 
- 			maxLengthText:'长度不得超出{0}',
 
- 			anchor:'75%'
 
- 		},{
 
- 			fieldLabel:'拼音',
 
- 			id: 'fm_V_PINYIN',
 
- 			name:'V_PINYIN',
 
- 			maxLength: 30,
 
- 			maxLengthText:'长度不得超出{0}',
 
- 			anchor:'75%'
 
- 		},{
 
- 			fieldLabel:'行政区域级别',
 
- 			id:'fm_E_LEVEL',
 
- 			name:'E_LEVEL',
 
- 			xtype:'combo',
 
- 			store:states2,
 
- 			displayField : 'name',  
 
- 	        valueField : 'status',
 
- 	        editable : false,
 
- 			maxLength: 30,
 
- 			maxLengthText:'长度不得超出{0}',
 
- 			anchor:'75%'
 
- 		},{
 
- 			fieldLabel:'修改行政区域说明',
 
- 			id: 'fm_V_COMMENT',
 
- 			name:'V_COMMENT',
 
- 			xtype: 'textareafield',
 
- 			maxLength: 250,
 
- 			maxLengthText:'长度不得超出{0}',
 
- 			anchor:'100%',
 
- 			value:'修改行政区域'
 
- 		},{
 
- 			id: 'fm_V_AREA_ID',
 
- 			name:'V_AREA_ID',
 
- 			hidden:true
 
- 		},{
 
- 			id:'fm_queryJson',
 
- 			name:'queryJson',
 
- 			hidden:true
 
- 		}],
 
- 		buttons: [{
 
- 	        text: '修改',
 
- 	        iconCls:'ok_btn',
 
- 		    handler: function() {
 
- 		    	var form = this.up('form').getForm();
 
- 		        if (form.isValid()) {
 
- 		        	var query = new Object();
 
- 		        	query.V_AREA_ID = Ext.getCmp('fm_V_AREA_ID').getValue();
 
- 		        	query.V_AREA_NAME = Ext.getCmp('fm_V_AREA_NAME').getValue();
 
- 		        	query.V_PARENT_ID = Ext.getCmp('fm_V_PARENT_ID').getValue();
 
- 		        	query.V_CITYCODE = Ext.getCmp('fm_V_CITYCODE').getValue();
 
- 		        	query.V_ZIPCODE = Ext.getCmp('fm_V_ZIPCODE').getValue();
 
- 		        	query.V_MERGERNAME = Ext.getCmp('fm_V_MERGERNAME').getValue();
 
- 		        	query.V_PINYIN = Ext.getCmp('fm_V_PINYIN').getValue();
 
- 		        	if(Ext.getCmp('fm_E_LEVEL').getValue()=='国家'){
 
- 		        		query.E_LEVEL=0;
 
- 		        	}
 
- 		        	if(Ext.getCmp('fm_E_LEVEL').getValue()=='省、直辖市、自治区、特别行政区'){
 
- 		        		query.E_LEVEL=1;
 
- 		        	}
 
- 		        	if(Ext.getCmp('fm_E_LEVEL').getValue()=='地区、市、自治州、盟'){
 
- 		        		query.E_LEVEL=2;
 
- 		        	}
 
- 		        	if(Ext.getCmp('fm_E_LEVEL').getValue()=='县、市辖区、县级市、旗'){
 
- 		        		query.E_LEVEL=3;
 
- 		        	}
 
- 		        	query.V_COMMENT = Ext.getCmp('fm_V_COMMENT').getValue();
 
- 		        	query.UQ_ADMIN_ID = '00000000-000000-000000-000000';
 
- 		        	var jsonstr = Ext.JSON.encode(query);
 
- 		        	Ext.getCmp('fm_queryJson').setValue(jsonstr);
 
- 		            form.submit({
 
- 		            	method:'post',
 
- 		                success: function(form, action) {
 
- 		                   Ext.Msg.alert('操作成功', '行政区域已修改', function(btn,txt){
 
- 		                	   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();
 
- 			}
 
- 		}]
 
- 	});
 
- 	
 
- 	var modifywin = function(){
 
- 		Ext.create('Ext.window.Window', {
 
- 		    title: '修改行政区域',
 
- 		    height: 400,
 
- 		    width: 400,
 
- 		    layout: 'fit',
 
- 		    items:  ModifyForm,
 
- 		    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.V_AREA_ID = selected[0].raw.V_AREA_ID;
 
- 			list.push(o);
 
- 			query.Area_LIST = list;
 
- 			var jsonstr= Ext.JSON.encode(query);
 
- 			Ext.MessageBox.confirm('注销行政区划','是否注销 '+selected[0].raw.V_AREA_NAME+' 行政区划?',function(btn){
 
- 				if(btn=='yes'){
 
- 					
 
- 				Ext.Ajax.request( { 
 
- 				        timeout : 3000000, 
 
- 				        url: baseUrl+'iot/area/delete',
 
- 				        params : 'queryJson='+ jsonstr, 
 
- 				        success: function(resp,opts){
 
- 				        	myStore.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.V_AREA_ID = selected[i].raw.V_AREA_ID;
 
- 					list.push(o);
 
- 				}
 
- 				query.Area_LIST = list;
 
- 				
 
- 				var jsonstr= Ext.JSON.encode(query);
 
- 				Ext.MessageBox.confirm('注销行政区划','是否注销选中的'+sm.getCount()+' 个行政区划?',function(btn){
 
- 					if(btn=='yes'){
 
- 						
 
- 					Ext.Ajax.request( { 
 
- 					        timeout : 3000000, 
 
- 					        url: baseUrl+'iot/area/delete',
 
- 					        params : 'queryJson='+ jsonstr, 
 
- 					        success: function(resp,opts){
 
- 					        	myStore.reload();
 
- 					        }
 
- 					});
 
- 					
 
- 					}
 
- 				},this);
 
- 			}else{
 
- 			Ext.Msg.alert('请先选择','至少选择一条记录,再点击注销');
 
- 		}
 
- 		}
 
- 	}
 
- 	
 
- 	var chk_sm = function() {
 
- 		if(sm.getCount()==1){
 
- 			modifywin();
 
- 			var selected = sm.getSelection( );
 
- 			Ext.getCmp('fm_V_AREA_ID').setValue(selected[0].raw.V_AREA_ID);
 
- 			Ext.getCmp('fm_V_AREA_NAME').setValue(selected[0].raw.V_AREA_NAME);
 
- 			Ext.getCmp('fm_V_PARENT_ID').setValue(selected[0].raw.V_PARENT_ID);
 
- 			Ext.getCmp('fm_V_CITYCODE').setValue(selected[0].raw.V_CITYCODE);
 
- 			Ext.getCmp('fm_V_ZIPCODE').setValue(selected[0].raw.V_ZIPCODE);
 
- 			Ext.getCmp('fm_V_MERGERNAME').setValue(selected[0].raw.V_MERGERNAME);
 
- 			Ext.getCmp('fm_V_PINYIN').setValue(selected[0].raw.V_PINYIN);
 
- 			Ext.getCmp('fm_E_LEVEL').setValue(selected[0].raw.E_LEVEL);
 
- 		}else{
 
- 			Ext.Msg.alert('请先选择','请先选择一条记录,再点击修改');
 
- 		}
 
- 	}
 
- 	Ext.create('Ext.grid.Panel', {
 
- 	    title: '行政区划信息',
 
- 	    id: 'AreaListPanel',
 
- 	    store: myStore,
 
- 	    selModel: sm,
 
- 	    columns: [
 
- 	        { header: 'ID',  dataIndex: 'V_AREA_ID',hidden:true, menuDisabled:true },
 
- 	        { header: '序号',  dataIndex: 'I_ORDER_IDX', width:40, menuDisabled:true },
 
- 	        { header: '行政区域名称', dataIndex: 'V_AREA_NAME', width:100,align:'center', menuDisabled:true },
 
- 	        { header: '上级区域ID', dataIndex: 'V_PARENT_ID', width:100,align:'center', menuDisabled:true },
 
- 	        { header: '区号', dataIndex: 'V_CITYCODE', width:100, align:'center', menuDisabled:true },
 
- 	        { header: '邮政编号', dataIndex: 'V_ZIPCODE', width:100,align:'center',  menuDisabled:true },
 
- 	        { header: '行政区域级别', dataIndex: 'E_LEVEL', width:100, align:'center', menuDisabled:true },
 
- 	        { header: '组合名称', dataIndex: 'V_MERGERNAME', width:100,align:'center',  menuDisabled:true },
 
- 	        { header: '保存时间', dataIndex: 'D_STORETIME',width:150, align:'center', menuDisabled:true },
 
- 	        { header: '记录版本', dataIndex: 'I_VERSION', width:80, align:'center', menuDisabled:true },
 
- 	        { 
 
- 	        	xtype : 'actioncolumn',
 
- 	        	width:20,
 
- 	        	sortable:false,
 
- 	        	align:'center',
 
- 	        	menuDisabled:true,
 
- 	        	items:[{
 
- 	        		icon: '../../res/img/common/forum.gif',
 
- 	        		tooltip: '版本记录',
 
- 	        		handler: function(grid, rowIndex, colIndex) {
 
- 	                    var rec = grid.getStore().getAt(rowIndex);
 
- 	        			window.location = 'version.jsp?theme='+theme+'&areaId='+rec.get('V_AREA_ID');
 
- 	                }
 
- 	        	}]
 
-     		}
 
- 	    ],
 
- 	    columnLines: true,
 
- 	    tbar: [
 
- 	    	{
 
- 				  xtype: 'button', 
 
- 				  iconCls:'filter_btn',  
 
- 				  text: '筛选',
 
- 				  listeners: {
 
- 				        click: filterwin
 
- 				  }
 
- 	    	},'-',
 
- 	    	{xtype: 'tbfill'},'-',
 
- 			{ 
 
- 				  xtype: 'button', 
 
- 				  iconCls:'append_btn',  
 
- 				  text: '新增',
 
- 				  listeners: {
 
- 				        click: appendwin
 
- 				  }
 
- 			},
 
- 			{ 
 
- 				xtype: 'button', 
 
- 				iconCls:'modify_btn', 
 
- 				text: '修改',
 
- 				listeners: {
 
- 					click: chk_sm
 
- 				}
 
- 			},
 
- 			{ 
 
- 				xtype: 'button',
 
- 				iconCls:'delete_btn',
 
- 				text: '注销',
 
- 				listeners: {
 
- 					click: del_sm
 
- 				}
 
- 			}
 
-     	],
 
-     	height: maxHeight,
 
- 	    width: '100%',
 
- 	    bbar: new Ext.PagingToolbar({  
 
-             store: myStore,  
 
-             id:'AreaListPageToolbar',
 
-             displayInfo: true,  
 
-             pageSize: countPerPage,  
 
-             prependButtons: true,  
 
-             displayMsg : '显示第 {0}条到 {1}条记录,总共 {2}条',     
 
-             emptyMsg : "没有记录",  
 
-             firstText: '第一页',
 
-             prevText: '前一页',
 
-             nextText: '后一页',
 
-             lastText: '最后一页',
 
-             refreshText: '刷新'//,
 
- //            doRefresh:function(start){  
 
- //            	alert(start);
 
- //                relushDataFunction(start); // 调用函数刷新数据  
 
- //                this.cursor = start; // 更新页签  
 
- //            }
 
-         }),
 
-         frame: true,  
 
-         border:false,  
 
-         iconCls: 'icon-grid',
 
- 	    renderTo: Ext.getBody()
 
- 	});
 
- 	myStore.reload();
 
- 	maxHeight =  document.documentElement.clientHeight;
 
- 	Ext.getCmp('AreaListPanel').setHeight(maxHeight);
 
- 	
 
- });
 
 
  |