123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752 |
- /**
- * Company.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 sm = Ext.create('Ext.selection.CheckboxModel');
- Ext.define('Unit',{
- extend: 'Ext.data.Model',
- fields: [
- {name:'UQ_UNIT_ID', type:'string'},
- {name:'I_ORDER_IDX', type:'int'},
- {name:'V_UNIT_CODE', type:'string'},
- {name:'UQ_IOTCARD_ID', type:'string'},
- {name:'UQ_COMPANY_ID', type:'string'},
- {name:'UQ_UNIT_MODEL_ID', type:'string'},
- {name:'V_UNIT_NAME', type:'string'},
- {name:'V_POSITION', type:'string'},
- {name:'UQ_EMPLOYEE_ID', type:'string'},
- {name:'E_STATUS', type:'string'},
- {name:'V_COMMENT', type:'string'},
- {name:'UQ_ADMIN_ID', type:'string'},
- {name:'I_VERSION', type:'int'},
- {name:'D_INSTALLTIME', 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 states1 = Ext.create('Ext.data.Store', {
- fields: ['status', 'name'],
- data : [
- // {"status":-1, "name":"全选"},
- {"status":"待开通", "name":"待开通"},
- {"status":"已开通", "name":"已开通"},
- {"status":"已锁定", "name":"已锁定"},
- {"status":"注销", "name":"注销"},
- ]
- });
- var clear_append_form = function (){
- Ext.getCmp('fa_V_UNIT_NAME').setValue("");
- Ext.getCmp('fa_V_UNIT_CODE').setValue("");
- Ext.getCmp('fa_UQ_COMPANY_ID').setValue("");
- Ext.getCmp('fa_UQ_UNIT_MODEL_ID').setValue("");
- Ext.getCmp('fa_V_POSITION').setValue("");
- Ext.getCmp('fa_UQ_EMPLOYEE_ID').setValue("");
- Ext.getCmp('fa_UQ_ADMIN_ID').setValue("");
- Ext.getCmp('fa_UQ_IOTCARD_ID').setValue("");
- Ext.getCmp('fa_V_COMMENT').setValue("");
- //Ext.getCmp('fa_E_STATUS').setValue();
- Ext.getCmp('UnitListPanel').getStore().reload();
- }
-
- var myStore = Ext.create('Ext.data.Store', {
- model: 'Unit',
- pageSize: countPerPage,
- proxy: {
- type: 'ajax',
- url: baseUrl+'iot/unit/getList',
- reader: {
- type: 'json',
- root: 'RESULT',
- totalProperty: 'totalCount'
- }
- },
- remoteSort: true
- });
-
- var AppendForm = Ext.create('Ext.form.Panel', {
- id: 'unitAppendForm',
- labelWidth: 55,
- url: baseUrl+'iot/unit/append',
- defaultType: 'textfield',
- bodyPadding: 15,
- items: [{
- fieldLabel:'监控单元名称',
- id: 'fa_V_UNIT_NAME',
- name:'V_UNIT_NAME',
- maxLength:20,
- maxLengthText:'长度不得超出{0}',
- anchor:'75%'
- },{
- fieldLabel:'监控单元编号',
- id: 'fa_V_UNIT_CODE',
- name: 'V_UNIT_CODE',
- maxLength: 250,
- maxLengthText:'长度不得超出{0}',
- anchor:'95%'
- },{
- fieldLabel:'物联网卡ID',
- id: 'fa_UQ_IOTCARD_ID',
- name: 'UQ_IOTCARD_ID',
- maxLength: 250,
- maxLengthText:'长度不得超出{0}',
- anchor:'95%'
- },{
- fieldLabel:'单位/部门ID',
- id: 'fa_UQ_COMPANY_ID',
- name: 'UQ_COMPANY_ID',
- maxLength: 250,
- maxLengthText:'长度不得超出{0}',
- anchor:'95%'
- },{
- fieldLabel:'监控单元型号ID',
- id: 'fa_UQ_UNIT_MODEL_ID',
- name: 'UQ_UNIT_MODEL_ID',
- maxLength: 250,
- maxLengthText:'长度不得超出{0}',
- anchor:'95%'
- },{
- fieldLabel:'监控单元安装位置',
- id: 'fa_V_POSITION',
- name: 'V_POSITION',
- maxLength: 250,
- maxLengthText:'长度不得超出{0}',
- anchor:'95%'
- },{
- fieldLabel:'安装人ID',
- id: 'fa_UQ_EMPLOYEE_ID',
- name: 'UQ_EMPLOYEE_ID',
- maxLength: 250,
- maxLengthText:'长度不得超出{0}',
- anchor:'95%'
- },{
- fieldLabel:'信息录入人ID',
- id: 'fa_UQ_ADMIN_ID',
- name:'UQ_ADMIN_ID',
- maxLength: 30,
- maxLengthText:'长度不得超出{0}',
- anchor:'95%'
- },{
- fieldLabel:'新增说明',
- id: 'fa_V_COMMENT',
- name:'V_COMMENT',
- xtype: 'textareafield',
- maxLength: 250,
- maxLengthText:'长度不得超出{0}',
- anchor:'100%'
- },{
- 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_UNIT_NAME = Ext.getCmp('fa_V_UNIT_NAME').getValue();
- query.V_UNIT_CODE = Ext.getCmp('fa_V_UNIT_CODE').getValue();
- query.UQ_COMPANY_ID = Ext.getCmp('fa_UQ_COMPANY_ID').getValue();
- query.UQ_UNIT_MODEL_ID = Ext.getCmp('fa_UQ_UNIT_MODEL_ID').getValue();
- query.V_POSITION = Ext.getCmp('fa_V_POSITION').getValue();
- query.UQ_ADMIN_ID = Ext.getCmp('fa_UQ_ADMIN_ID').getValue();
- query.UQ_EMPLOYEE_ID = Ext.getCmp('fa_UQ_EMPLOYEE_ID').getValue();
- query.UQ_IOTCARD_ID = Ext.getCmp('fa_UQ_IOTCARD_ID').getValue();
- query.V_COMMENT = Ext.getCmp('fa_V_COMMENT').getValue();
- // query.E_STATUS = Ext.getCmp('fa_E_STATUS').getValue(0);
- 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: 450,
- width: 400,
- layout: 'fit',
- items: AppendForm,
- closeAction: 'hide'
- }).show();
- }
-
- //筛选
- var states2 = Ext.create('Ext.data.Store', {
- fields: ['status', 'name'],
- data : [
- {"status":10, "name":"全选"},
- {"status":0, "name":"待开通"},
- {"status":1, "name":"已开通"},
- {"status":2, "name":"已锁定"},
- {"status":3, "name":"注销"},
- ]
- });
-
- var clear_filter_form = function(){
- Ext.getCmp('ff_V_UNIT_NAME').setValue("");
- Ext.getCmp('ff_UQ_UNIT_MODEL_ID').setValue("");
- Ext.getCmp('ff_UQ_COMPANY_ID').setValue("");
- Ext.getCmp('ff_V_UNIT_CODE').setValue("");
- Ext.getCmp('ff_UQ_EMPLOYEE_ID').setValue("");
- Ext.getCmp('ff_E_STATUS').setValue("10");
- // Ext.getCmp('ff_V_COMMENT').setValue("");
- }
- //
- //
- var states = Ext.create('Ext.data.Store', {
- fields: ['status', 'name'],
- data : [
- {"status":-1, "name":"全选"},
- {"status":0, "name":"无效"},
- {"status":1, "name":"有效"}
- ]
- });
-
- var FilterWin = Ext.create('Ext.form.Panel', {
- id: 'UnitFilterForm',
- labelWidth: 55,
- defaultType: 'textfield',
- bodyPadding: 15,
- items: [{
- fieldLabel:'监控单元名称',
- id: 'ff_V_UNIT_NAME',
- name:'V_UNIT_NAME',
- maxLength:20,
- maxLengthText:'长度不得超出{0}',
- value : document.getElementById('unitName').value,
- anchor:'75%'
- },{
- fieldLabel:'当前状态',
- id:'ff_E_STATUS',
- name:'E_STATUS',
- xtype:'combo',
- store:states2,
- displayField : 'name',
- valueField : 'status',
- value : document.getElementById('estatus').value,
- editable : false
- },{
- fieldLabel:'监控单元型号ID',
- id: 'ff_UQ_UNIT_MODEL_ID',
- name: 'UQ_UNIT_MODEL_ID',
- maxLength: 250,
- maxLengthText:'长度不得超出{0}',
- value : document.getElementById('unitModelId').value,
- anchor:'95%'
- },{
- fieldLabel:'单位/部门ID',
- id: 'ff_UQ_COMPANY_ID',
- name:'UQ_COMPANY_ID',
- maxLength: 30,
- maxLengthText:'长度不得超出{0}',
- value : document.getElementById('companyId').value,
- anchor:'95%'
- },{
- fieldLabel:'监控单元编号',
- id: 'ff_V_UNIT_CODE',
- name:'UQ_V_UNIT_CODE',
- maxLength: 30,
- maxLengthText:'长度不得超出{0}',
- value : document.getElementById('unitCode').value,
- anchor:'95%'
- },{
- fieldLabel:'安装人ID',
- id: 'ff_UQ_EMPLOYEE_ID',
- name:'UQ_EMPLOYEE_ID',
- maxLength: 30,
- maxLengthText:'长度不得超出{0}',
- value : document.getElementById('employeeId').value,
- anchor:'95%'
- },{
- 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_UNIT_NAME').getValue().length>0)
- query.V_UNIT_NAME = Ext.getCmp('ff_V_UNIT_NAME').getValue();
- if(Ext.getCmp('ff_UQ_UNIT_MODEL_ID').getValue().length>0)
- query.UQ_UNIT_MODEL_ID = Ext.getCmp('ff_UQ_UNIT_MODEL_ID').getValue();
- query.E_STATUS = Ext.getCmp('ff_E_STATUS').getValue();
- if(Ext.getCmp('ff_UQ_COMPANY_ID').getValue().length>0)
- query.UQ_COMPANY_ID = Ext.getCmp('ff_UQ_COMPANY_ID').getValue();
- if(Ext.getCmp('ff_V_UNIT_CODE').getValue().length>0)
- query.V_UNIT_CODE = Ext.getCmp('ff_V_UNIT_CODE').getValue();
- if(Ext.getCmp('ff_UQ_EMPLOYEE_ID').getValue().length>0)
- query.UQ_EMPLOYEE_ID = Ext.getCmp('ff_UQ_EMPLOYEE_ID').getValue();
-
- var jsonstr = Ext.JSON.encode(query);
- myStore.getProxy().extraParams = {
- queryJson : jsonstr
- };
- Ext.getCmp('UnitListPageToolbar').moveFirst();
- Ext.getCmp('unitName').setValue(query.V_UNIT_NAME);
- Ext.getCmp('unitModelId').setValue(query.UQ_UNIT_MODEL_ID);
- Ext.getCmp('companyId').setValue(query.UQ_COMPANY_ID);
- Ext.getCmp('unitCode').setValue(query.UQ_V_UNIT_CODE);
- Ext.getCmp('employeeId').setValue(query.UQ_EMPLOYEE_ID);
- Ext.getCmp('estatus').setValue(query.E_STATUS);
- // myStore.reload();
- 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',{
- title: '筛选',
- height: 300,
- width: 350,
- layout: 'fit',
- items: FilterWin,
- closeAction: 'hide'
- }).show();
- }
-
- var clear_modify_form = function (){
- //Ext.getCmp('fm_V_UNIT_ID').setValue("");
- Ext.getCmp('fm_V_UNIT_NAME').setValue("");
- Ext.getCmp('fm_V_UNIT_CODE').setValue("");
- Ext.getCmp('fm_UQ_COMPANY_ID').setValue("");
- Ext.getCmp('fm_UQ_UNIT_MODEL_ID').setValue("");
- Ext.getCmp('fm_V_POSITION').setValue("");
- Ext.getCmp('fm_UQ_EMPLOYEE_ID').setValue("");
- Ext.getCmp('fm_UQ_ADMIN_ID').setValue("0000-0000-0000");
- Ext.getCmp('fm_E_STATUS').setValue(10);
- Ext.getCmp('fm_UQ_IOTCARD_ID').setValue("");
- Ext.getCmp('fm_V_COMMENT').setValue("");
- Ext.getCmp('UnitListPanel').getStore().reload();
- }
-
-
-
- var ModifyForm = Ext.create('Ext.form.Panel', {
- id: 'UnitEditForm',
- labelWidth: 55,
- url: baseUrl+'iot/unit/update',
- defaultType: 'textfield',
- bodyPadding: 15,
- items: [{
- fieldLabel:'监控单元名称',
- id: 'fm_V_UNIT_NAME',
- name:'V_UNIT_NAME',
- maxLength:20,
- maxLengthText:'长度不得超出{0}',
- anchor:'75%'
- },{
- fieldLabel:'监控单元编号',
- id: 'fm_V_UNIT_CODE',
- name: 'V_UNIT_CODE',
- maxLength: 250,
- maxLengthText:'长度不得超出{0}',
- anchor:'95%'
- },
- {
- fieldLabel:'单位/部门ID',
- id: 'fm_UQ_COMPANY_ID',
- name: 'UQ_COMPANY_ID',
- maxLength: 250,
- maxLengthText:'长度不得超出{0}',
- anchor:'95%'
- },{
- fieldLabel:'监控单元型号ID',
- id: 'fm_UQ_UNIT_MODEL_ID',
- name: 'UQ_UNIT_MODEL_ID',
- maxLength: 250,
- maxLengthText:'长度不得超出{0}',
- anchor:'95%'
- },{
- fieldLabel:'监控单元安装位置',
- id: 'fm_V_POSITION',
- name: 'V_POSITION',
- maxLength: 250,
- maxLengthText:'长度不得超出{0}',
- anchor:'95%'
- },{
- fieldLabel:'安装人ID',
- id: 'fm_UQ_EMPLOYEE_ID',
- name: 'UQ_EMPLOYEE_ID',
- maxLength: 250,
- maxLengthText:'长度不得超出{0}',
- anchor:'95%'
- },{
- fieldLabel:'录入人ID',
- id: 'fm_UQ_ADMIN_ID',
- name:'UQ_ADMIN_ID',
- maxLength: 250,
- value : "0000-0000-0000",
- maxLengthText:'长度不得超出{0}',
- anchor:'95%'
- },{
- fieldLabel:'物联网卡ID',
- id: 'fm_UQ_IOTCARD_ID',
- name: 'UQ_IOTCARD_ID',
- maxLength: 250,
- maxLengthText:'长度不得超出{0}',
- anchor:'95%'
- },{
- fieldLabel:'当前状态',
- id:'fm_E_STATUS',
- name:'E_STATUS',
- xtype:'combo',
- store:states1,
- displayField : 'name',
- valueField : 'status',
- value : 0,
- editable : false
- },{
- fieldLabel:'新增说明',
- id: 'fm_V_COMMENT',
- name:'V_COMMENT',
- xtype: 'textareafield',
- maxLength: 250,
- maxLengthText:'长度不得超出{0}',
- anchor:'100%'
- },{
- id: 'fm_UQ_UNIT_ID',
- name:'UQ_UNIT_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.UQ_UNIT_ID = Ext.getCmp('fm_UQ_UNIT_ID').getValue();
-
-
- query.UQ_IOTCARD_ID = Ext.getCmp('fm_UQ_IOTCARD_ID').getValue();
- query.V_COMMENT = Ext.getCmp('fm_V_COMMENT').getValue();
-
- query.V_UNIT_NAME = Ext.getCmp('fm_V_UNIT_NAME').getValue();
- query.V_UNIT_CODE = Ext.getCmp('fm_V_UNIT_CODE').getValue();
- query.UQ_COMPANY_ID = Ext.getCmp('fm_UQ_COMPANY_ID').getValue();
- query.UQ_UNIT_MODEL_ID = Ext.getCmp('fm_UQ_UNIT_MODEL_ID').getValue();
- query.V_POSITION = Ext.getCmp('fm_V_POSITION').getValue();
- query.UQ_EMPLOYEE_ID = Ext.getCmp('fm_UQ_EMPLOYEE_ID').getValue();
- query.UQ_ADMIN_ID = Ext.getCmp('fm_UQ_ADMIN_ID').getValue();
- if(Ext.getCmp('fm_E_STATUS').getValue()=="待开通"){
- query.E_STATUS=0;
- }
- if(Ext.getCmp('fm_E_STATUS').getValue()=="已开通"){
- query.E_STATUS=1;
- }
- if(Ext.getCmp('fm_E_STATUS').getValue()=="已锁定"){
- query.E_STATUS=2;
- }
- if(Ext.getCmp('fm_E_STATUS').getValue()=="注销"){
- query.E_STATUS=3;
- }
- var jsonstr = Ext.JSON.encode(query);
- Ext.getCmp('fm_queryJson').setValue(jsonstr);
- form.submit({
- method:'post',
- success: function(form, action) {
- //Ext.getCmp('adminId').setValue(query.UQ_ADMIN_ID);
- 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: 500,
- width: 400,
- layout: 'fit',
- items: ModifyForm,
- closeAction: 'hide'
- }).show();
- }
-
- var chk_sm = function() {
- if(sm.getCount()==1){
- modifywin();
- var selected = sm.getSelection( );
- // var estatus = parseInt(selected[0].raw.E_STATUS);
- Ext.getCmp('fm_UQ_IOTCARD_ID').setValue(selected[0].raw.UQ_IOTCARD_ID);
- Ext.getCmp('fm_E_STATUS').setValue(selected[0].raw.E_STATUS);
- //Ext.getCmp('fm_V_COMMENT').setValue(selected[0].raw.V_COMMENT);
-
-
- Ext.getCmp('fm_UQ_UNIT_ID').setValue(selected[0].raw.UQ_UNIT_ID);
- Ext.getCmp('fm_V_UNIT_NAME').setValue(selected[0].raw.V_UNIT_NAME);
- Ext.getCmp('fm_V_UNIT_CODE').setValue(selected[0].raw.V_UNIT_CODE);
- Ext.getCmp('fm_V_POSITION').setValue(selected[0].raw.V_POSITION);
- Ext.getCmp('fm_UQ_COMPANY_ID').setValue(selected[0].raw.UQ_COMPANY_ID);
- Ext.getCmp('fm_UQ_UNIT_MODEL_ID').setValue(selected[0].raw.UQ_UNIT_MODEL_ID);
- //Ext.getCmp('fm_UQ_ADMIN_ID').setValue(selected[0].raw.UQ_ADMIN_ID);
- Ext.getCmp('fm_UQ_EMPLOYEE_ID').setValue(selected[0].raw.UQ_EMPLOYEE_ID);
- }else{
- Ext.Msg.alert('请先选择','请先选择一条记录,再点击修改');
- }
- }
-
-
-
-
- var clear_filter_form1 = function(){
- Ext.getCmp('fc_V_COMPANY_NAME').setValue("");
- Ext.getCmp('fc_V_COMPANY_ADDRESS_0').setValue("");
- Ext.getCmp('fc_E_STATUS').setValue(-1);
- Ext.getCmp('fc_UQ_ADMIN_ID').setValue("");
- Ext.getCmp('fc_V_COMMENT').setValue("");
- // Ext.getCmp('PermissionListPanel').getStore().reload();
- }
- var deletewin = function() {
- if(sm.getCount()>=1){
- // var companyname = selected[0].raw.V_COMPANY_NAME;
- // window.alert(selected[0].raw);
- 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.UQ_UNIT_ID = selected[i].raw.UQ_UNIT_ID;
- list.push(o);
- }
-
- query.UNIT_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/unit/del',
- params : 'queryJson='+ jsonstr,
- success: function(resp,opts){
- myStore.reload();
- }
- });
-
- }
- },this);
- }else{
- Ext.Msg.alert('请先选择','请先选择一条记录,再点击删除');
- }
- }
- //导出
- // var export_sj = function() {
- // Ext.Ajax.request( {
- // timeout : 3000000,
- // url: baseUrl+'iot/unit/exd',
- //// params : 'queryJson='+ jsonstr,
- //// success: function(resp,opts){
- //// myStore.reload();
- //// }
- // });
- // }
- //导出。
-
-
-
-
-
- Ext.create('Ext.grid.Panel', {
- title: '监控单元管理',
- id: 'UnitListPanel',
- store: myStore,
- selModel: sm,
- columns: [
- //{ header: 'ID', dataIndex: 'UQ_UNIT_ID',hidden:true, menuDisabled:true },
- { header: '序号', dataIndex: 'I_ORDER_IDX', width:40, menuDisabled:true },
- { header: '监控单元名称', dataIndex: 'V_UNIT_NAME', width:120,align:'center', menuDisabled:true },
- { header: '监控单元安装位置', dataIndex: 'V_POSITION', width:160,align:'center', menuDisabled:true },
- { header: '监控单元型号ID', dataIndex: 'UQ_UNIT_MODEL_ID', width:120,align:'center', menuDisabled:true },
- { header: '单位/部门ID', dataIndex: 'UQ_COMPANY_ID', width:120,align:'center', menuDisabled:true },
- { header: '安装人ID', dataIndex: 'UQ_EMPLOYEE_ID', width:100,align:'center', menuDisabled:true },
- { header: '监控单元编号', dataIndex: 'V_UNIT_CODE', width:120,align:'center', menuDisabled:true },
- { header: '当前状态', dataIndex: 'E_STATUS',width:120, align:'center', menuDisabled:true },
- { header: '保存时间', dataIndex: 'D_INSTALLTIME',width:160, align:'center', menuDisabled:true },
- { header: '记录版本', dataIndex: 'I_VERSION', width:120, 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+'&unitId='+rec.get('UQ_UNIT_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: deletewin
- }
- }
- // ,{
- // xtype: 'button',
- // iconCls:'delete_btn',
- // text: '导出',
- // listeners: {
- // click: export_sj
- // }
- // }
-
- ],
- height: maxHeight,
- width: '100%',
- bbar: new Ext.PagingToolbar({
- store: myStore,
- id:'UnitListPageToolbar',
- 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('UnitListPanel').setHeight(maxHeight);
-
- });
|