123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863 |
- /**
- * OutcryPackage.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('OutcryPackage',{
- extend: 'Ext.data.Model',
- fields: [
- {name:'UQ_SETMREAL_ZB_ID', type:'string'},
- {name:'UQ_SETMREAL_ID', type:'string'},
- {name:'I_ORDER_IDX', type:'int'},
- {name:'UQ_CATEGORY', type:'string'},
- {name:'UQ_CATEGORY1', type:'string'},
- {name:'I_NUMBER_OF_BARS', type:'string'},
- {name:'V_COMPANY_NAME', type:'string'},
- {name:'I_CYCLE', type:'string'},
- {name:'I_CYCLE1', type:'string'},
- {name:'UQ_COMPANY_ID', type:'string'},
- {name:'D_START_STORETIME', type:'string'},
- {name:'D_END_STORETIME', type:'string'},
- {name:'V_PHONE', type:'string'},
- {name:'E_STATUS', type:'string'},
- ]
- });
- Ext.define('CompanyComboStore',{
- extend:'Ext.data.Model',
- fields: [
- {name:'owner_name', type:'string'},
- {name:'owner_id',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 states = Ext.create('Ext.data.Store', {
- fields: ['status', 'name'],
- data : [
- {"status":1, "name":"火系统报警"},
- {"status":2, "name":"水系统报警"},
- {"status":3, "name":"烟感报警"},
- {"status":4, "name":"消防栓报警"},
- {"status":5, "name":"液位报警"},
- {"status":6, "name":"RTU报警"},
- {"status":7, "name":"电气火灾报警"},
- {"status":8, "name":"离线报警"},
- ]
- });
- var states1 = Ext.create('Ext.data.Store', {
- fields: ['status', 'name'],
- data : [
- {"status":0, "name":"天"},
- {"status":1, "name":"月"},
- {"status":2, "name":"年"},
- ]
- });
-
-
- var clear_append_form = function (){
- Ext.getCmp('fa_UQ_COMPANY_ID').setValue("");
- Ext.getCmp('fa_UQ_CATEGORY').setValue("");
- Ext.getCmp('fa_I_NUMBER_OF_BARS').setValue("");
- Ext.getCmp('fa_I_CYCLE').setValue("");
- Ext.getCmp('fa_D_START_STORETIME').setValue("");
- Ext.getCmp('fa_D_END_STORETIME').setValue("");
- Ext.getCmp('fa_V_PHONE').setValue("");
- Ext.getCmp('OutcryPackageListPanel').getStore().reload();
- }
-
- var myStore = Ext.create('Ext.data.Store', {
- model: 'OutcryPackage',
- pageSize: countPerPage,
- proxy: {
- type: 'ajax',
- url: baseUrl+'iot/outcrypackage/getList',
- reader: {
- type: 'json',
- root: 'RESULT',
- totalProperty: 'totalCount'
- }
- },
- remoteSort: true
- });
- var CompanyStory = Ext.create('Ext.data.Store', {
- model: 'CompanyComboStore',
- pageSize: countPerPage,
- proxy: {
- type: 'ajax',
- url: baseUrl+'iot/company/view/getNameList',
- reader: {
- type: 'json',
- root: 'RESULT',
- totalProperty: 'totalCount'
- }
- },
- remoteSort: true
- });
- var data =Ext.Date.format(new Date(), 'm/d/Y');
- var AppendForm = Ext.create('Ext.form.Panel', {
- id: 'OutcryPackageAppendForm',
- labelWidth: 55,
- url: baseUrl+'iot/outcrypackage/append',
- defaultType: 'textfield',
- bodyPadding: 15,
- items: [{
- xtype:'combo',
- fieldLabel:'单位名称',
- id: 'fa_UQ_COMPANY_ID',
- name:'UQ_COMPANY_ID',
- displayField : 'owner_name',
- valueField : 'owner_id',
- editable : false,
- width:330,
- store:CompanyStory
- },{
- fieldLabel:'类别',
- id:'fa_UQ_CATEGORY',
- name:'UQ_CATEGORY',
- xtype:'combo',
- store:states,
- displayField : 'name',
- valueField : 'status',
- width:330,
- editable : false
- },{
- fieldLabel:'规格',
- id:'fa_I_CYCLE',
- name:'I_CYCLE',
- xtype:'combo',
- store:states1,
- displayField : 'name',
- valueField : 'status',
- width:330,
- editable : false
- },{
- fieldLabel:'数量',
- id: 'fa_I_NUMBER_OF_BARS',
- name: 'I_NUMBER_OF_BARS',
- maxLength: 300,
- maxLengthText:'长度不得超出{0}',
- anchor:'90%'
- },{
- fieldLabel:'手机号 ',
- id: 'fa_V_PHONE',
- name: 'V_PHONE',
- maxLength: 11,
- maxLengthText:'长度不得超出{0}',
- anchor:'90%'
- },{
- xtype:'datefield',
- fieldLabel:"开始日期",
- minValue:data,
- // '07/07/2017',
- minText:"当前日期选择应大于当天日期",
- format:"Y-m-d",
- columnWidth:0.5,
- id: 'fa_D_START_STORETIME',
- name:"D_END_STORETIME",
- editable:false,//只读约束
- anchor:'80%'
-
- // fieldLabel:'开始日期',
- // id: 'fa_D_START_STORETIME',
- // name: 'D_START_STORETIME',
- // maxLength: 250,
- // maxLengthText:'长度不得超出{0}',
- // anchor:'95%'
- },{
- xtype:'datefield',
- fieldLabel:"结束日期",
- minValue:data,
- // '07/07/2017',
- minText:"当前日期选择应大于当天日期",
- format:"Y-m-d",
- columnWidth:0.5,
- id: 'fa_D_END_STORETIME',
- name:"D_END_STORETIME",
- editable:false,//只读约束
- anchor:'80%'
-
- // fieldLabel:'结束日期',
- // id: 'fa_D_END_STORETIME',
- // name:'D_END_STORETIME',
- // maxLength: 30,
- // maxLengthText:'长度不得超出{0}',
- // anchor:'95%'
- },{
- 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.UQ_COMPANY_ID = Ext.getCmp('fa_UQ_COMPANY_ID').getValue();
- query.UQ_CATEGORY = Ext.getCmp('fa_UQ_CATEGORY').getValue();
- query.I_NUMBER_OF_BARS = Ext.getCmp('fa_I_NUMBER_OF_BARS').getValue();
- query.I_CYCLE = Ext.getCmp('fa_I_CYCLE').getValue();
- query.D_START_STORETIME = Ext.getCmp('fa_D_START_STORETIME').getValue();
- query.D_END_STORETIME = Ext.getCmp('fa_D_END_STORETIME').getValue();
- query.V_PHONE = Ext.getCmp('fa_V_PHONE').getValue();
- 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 clear_filter_form = function(){
- Ext.getCmp('ff_UQ_COMPANY_ID').setValue("");
- Ext.getCmp('ff_D_START_STORETIME').setValue("");
- Ext.getCmp('ff_D_END_STORETIME').setValue("");
- Ext.getCmp('ff_UQ_CATEGORY').setValue("");
- Ext.getCmp('ff_I_NUMBER_OF_BARS').setValue("");
- Ext.getCmp('ff_I_CYCLE').setValue("");
- }
-
-
- var FilterWin = Ext.create('Ext.form.Panel', {
- id: 'OutcryPackageFilterForm',
- labelWidth: 55,
- defaultType: 'textfield',
- bodyPadding: 15,
- items: [{
- // xtype:'combo',
- // fieldLabel:'单位名称',
- // id: 'ff_UQ_COMPANY_ID',
- // name:'UQ_COMPANY_ID',
- // displayField : 'owner_name',
- // valueField : 'owner_id',
- // value : document.getElementById('companyId').value,
- // editable : false,
- // width:330,
- // store:CompanyStory
-
-
- fieldLabel:'单位编号',
- id: 'ff_UQ_COMPANY_ID',
- name:'UQ_COMPANY_ID',
- maxLength:20,
- maxLengthText:'长度不得超出{0}',
- value : document.getElementById('companyId').value,
- anchor:'95%'
- },{
- // fieldLabel:'类别',
- // id:'ff_UQ_CATEGORY',
- // name:'UQ_CATEGORY',
- // xtype:'combo',
- // store:states,
- // displayField : 'name',
- // valueField : 'status',
- //// value : -1,
- // width:330,
- // editable : false
-
- fieldLabel:'类别',
- id: 'ff_UQ_CATEGORY',
- name:'UQ_CATEGORY',
- maxLength: 30,
- maxLengthText:'长度不得超出{0}',
- value : document.getElementById('uqCategory').value,
- anchor:'95%'
- },{
- // fieldLabel:'规格',
- // id:'ff_I_CYCLE',
- // name:'I_CYCLE',
- // xtype:'combo',
- // store:states1,
- // displayField : 'name',
- // valueField : 'status',
- // width:330,
- // editable : false
-
- fieldLabel:'规格',
- id: 'ff_I_CYCLE',
- name:'I_CYCLE',
- maxLength: 30,
- maxLengthText:'长度不得超出{0}',
- value : document.getElementById('iCycle').value,
- anchor:'95%'
- },{
- fieldLabel:'数量',
- id: 'ff_I_NUMBER_OF_BARS',
- name:'I_NUMBER_OF_BARS',
- maxLength: 30,
- maxLengthText:'长度不得超出{0}',
- value : document.getElementById('iNumberOfBars').value,
- anchor:'95%'
- },{
- fieldLabel:'手机号 ',
- id: 'ff_V_PHONE',
- name: 'V_PHONE',
- maxLength: 11,
- maxLengthText:'长度不得超出{0}',
- value : document.getElementById('vPhone').value,
- anchor:'95%'
- },{
- fieldLabel:'开始日期',
- id: 'ff_D_START_STORETIME',
- name: 'D_START_STORETIME',
- maxLength: 250,
- maxLengthText:'长度不得超出{0}',
- value : document.getElementById('dStartStoretime').value,
- anchor:'95%'
- },{
- fieldLabel:'结束日期',
- id: 'ff_D_END_STORETIME',
- name:'D_END_STORETIME',
- maxLength: 30,
- maxLengthText:'长度不得超出{0}',
- value : document.getElementById('dEndStoretime').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_UQ_COMPANY_ID').getValue().length>0)
- query.UQ_COMPANY_ID = Ext.getCmp('ff_UQ_COMPANY_ID').getValue();
- if(Ext.getCmp('ff_V_PHONE').getValue().length>0)
- query.V_PHONE = Ext.getCmp('ff_V_PHONE').getValue();
- if(Ext.getCmp('ff_D_START_STORETIME').getValue().length>0)
- query.D_START_STORETIME = Ext.getCmp('ff_D_START_STORETIME').getValue();
- if(Ext.getCmp('ff_D_END_STORETIME').getValue().length>0)
- query.D_END_STORETIME = Ext.getCmp('ff_D_END_STORETIME').getValue();
-
- if(Ext.getCmp('ff_UQ_CATEGORY').getValue().length>0){
- var a = Ext.getCmp('ff_UQ_CATEGORY').getValue();
- if(a=="火系统报警") {
- query.UQ_CATEGORY = 1;
- }else if(a=="水系统报警") {
- query.UQ_CATEGORY = 2;
- }else if(a=="烟感报警") {
- query.UQ_CATEGORY = 3;
- }else if(a=="消防栓报警") {
- query.UQ_CATEGORY = 4;
- }else if(a=="液位报警") {
- query.UQ_CATEGORY = 5;
- }else if(a=="RTU报警") {
- query.UQ_CATEGORY = 6;
- }else if(a=="电气火灾报警") {
- query.UQ_CATEGORY = 7;
- }else if(a=="离线报警") {
- query.UQ_CATEGORY = 8;
- }else{
- query.UQ_CATEGORY = Ext.getCmp('ff_UQ_CATEGORY').getValue();
- }
- }
-
-
- if(Ext.getCmp('ff_I_NUMBER_OF_BARS').getValue().length>0)
- query.I_NUMBER_OF_BARS = Ext.getCmp('ff_I_NUMBER_OF_BARS').getValue();
- if(Ext.getCmp('ff_I_CYCLE').getValue().length>0){
- var b = Ext.getCmp('ff_I_CYCLE').getValue();
- if(b=="天") {
- query.I_CYCLE =0;
- }else if(b=="月") {
- query.I_CYCLE =1;
- }else if(b=="年") {
- query.I_CYCLE =2;
- }else{
- query.I_CYCLE = Ext.getCmp('ff_I_CYCLE').getValue();
- }
- }
-
- var jsonstr = Ext.JSON.encode(query);
- myStore.getProxy().extraParams = {
- queryJson : jsonstr
- };
- Ext.getCmp('OutcryPackageListPageToolbar').moveFirst();
- Ext.getCmp('companyId').setValue(query.UQ_COMPANY_ID);
- Ext.getCmp('dStartStoretime').setValue(query.D_START_STORETIME);
- Ext.getCmp('uqCategory').setValue(query.UQ_CATEGORY);
- Ext.getCmp('dEndStoretime').setValue(query.D_END_STORETIME);
- Ext.getCmp('iNumberOfBars').setValue(query.I_NUMBER_OF_BARS);
- Ext.getCmp('iCycle').setValue(query.I_CYCLE);
- Ext.getCmp('vPhone').setValue(query.V_PHONE);
- // 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: 320,
- width: 380,
- layout: 'fit',
- items: FilterWin,
- closeAction: 'hide'
- }).show();
- }
-
-
-
- var states4 = Ext.create('Ext.data.Store', {
- fields: ['status', 'name'],
- data : [
- // {"status":-1, "name":"全选"},
- {"status":"待开通", "name":"待开通"},
- {"status":"已开通", "name":"已开通"},
- {"status":"已锁定", "name":"已锁定"},
- {"status":"注销", "name":"注销"},
- ]
- });
-
- var clear_modify_form = function (){
- Ext.getCmp('fm_UQ_COMPANY_ID').setValue("");
- Ext.getCmp('fm_E_STATUS').setValue("");
- Ext.getCmp('fm_D_START_STORETIME').setValue("");
- Ext.getCmp('fm_D_END_STORETIME').setValue("");
- Ext.getCmp('fm_UQ_CATEGORY').setValue("");
- Ext.getCmp('fm_I_NUMBER_OF_BARS').setValue("");
- Ext.getCmp('fm_I_CYCLE').setValue("");
- Ext.getCmp('fm_UQ_SETMREAL_ZB_ID').setValue("");
- Ext.getCmp('fm_UQ_SETMREAL_ID').setValue("");
- Ext.getCmp('fm_V_PHONE').setValue("");
- Ext.getCmp('OutcryPackageListPanel').getStore().reload();
- }
-
-
-
- var ModifyForm = Ext.create('Ext.form.Panel', {
- id: 'OutcryPackageEditForm',
- labelWidth: 55,
- url: baseUrl+'iot/outcrypackage/update',
- defaultType: 'textfield',
- bodyPadding: 15,
- items: [{
- xtype:'combo',
- fieldLabel:'单位名称',
- id: 'fm_UQ_COMPANY_ID',
- name:'UQ_COMPANY_ID',
- displayField : 'owner_name',
- valueField : 'owner_name',
- editable : false,
- width:330,
- store:CompanyStory
- },{
- fieldLabel:'类别',
- id:'fm_UQ_CATEGORY',
- name:'UQ_CATEGORY',
- xtype:'combo',
- store:states,
- displayField : 'name',
- valueField : 'status',
- // value : -1,
- width:330,
- editable : false
- },{
- fieldLabel:'规格',
- id:'fm_I_CYCLE',
- name:'I_CYCLE',
- xtype:'combo',
- store:states1,
- displayField : 'name',
- valueField : 'status',
- width:330,
- editable : false,
- },{
- fieldLabel:'数量',
- id: 'fm_I_NUMBER_OF_BARS',
- name: 'I_NUMBER_OF_BARS',
- maxLength: 250,
- maxLengthText:'长度不得超出{0}',
- anchor:'90%'
- },{
- fieldLabel:'当前状态',
- id:'fm_E_STATUS',
- name:'E_STATUS',
- xtype:'combo',
- store:states4,
- displayField : 'name',
- valueField : 'status',
- value : -1,
- editable : false
- },{
- fieldLabel:'手机号 ',
- id: 'fm_V_PHONE',
- name: 'V_PHONE',
- maxLength: 11,
- maxLengthText:'长度不得超出{0}',
- anchor:'90%'
- },{
- fieldLabel:'开始日期',
- id: 'fm_D_START_STORETIME',
- name: 'D_START_STORETIME',
- maxLength: 250,
- maxLengthText:'长度不得超出{0}',
- anchor:'90%'
- },{
- fieldLabel:'结束日期',
- id: 'fm_D_END_STORETIME',
- name: 'D_END_STORETIME',
- maxLength: 250,
- maxLengthText:'长度不得超出{0}',
- anchor:'90%'
- },{
- id: 'fm_UQ_SETMREAL_ZB_ID',
- name:'UQ_SETMREAL_ZB_ID',
- hidden:true
- },{
- id: 'fm_UQ_SETMREAL_ID',
- name:'UQ_SETMREAL_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();
- var a = Ext.getCmp('fm_UQ_CATEGORY').getValue();
- if(a=="火系统报警") {
- query.UQ_CATEGORY = 1;
- }else if(a=="水系统报警") {
- query.UQ_CATEGORY = 2;
- }else if(a=="烟感报警") {
- query.UQ_CATEGORY = 3;
- }else if(a=="消防栓报警") {
- query.UQ_CATEGORY = 4;
- }else if(a=="液位报警") {
- query.UQ_CATEGORY = 5;
- }else if(a=="RTU报警") {
- query.UQ_CATEGORY = 6;
- }else if(a=="电气火灾报警") {
- query.UQ_CATEGORY = 7;
- }else if(a=="离线报警") {
- query.UQ_CATEGORY = 8;
- }else{
- query.UQ_CATEGORY = Ext.getCmp('fm_UQ_CATEGORY').getValue();
- }
-
- var b = Ext.getCmp('fm_I_CYCLE').getValue();
- if(b=="天") {
- query.I_CYCLE =0;
- }else if(b=="月") {
- query.I_CYCLE =1;
- }else if(b=="年") {
- query.I_CYCLE =2;
- }else{
- query.I_CYCLE = Ext.getCmp('fm_I_CYCLE').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;
- }
-
- query.UQ_COMPANY_ID = Ext.getCmp('fm_UQ_COMPANY_ID').getValue();
- query.V_PHONE = Ext.getCmp('fm_V_PHONE').getValue();
- query.D_START_STORETIME = Ext.getCmp('fm_D_START_STORETIME').getValue();
- query.UQ_SETMREAL_ZB_ID = Ext.getCmp('fm_UQ_SETMREAL_ZB_ID').getValue();
- query.UQ_SETMREAL_ID = Ext.getCmp('fm_UQ_SETMREAL_ID').getValue();
- // query.I_CYCLE = Ext.getCmp('fm_I_CYCLE').getValue();
- query.I_NUMBER_OF_BARS = Ext.getCmp('fm_I_NUMBER_OF_BARS').getValue();
- query.D_END_STORETIME = Ext.getCmp('fm_D_END_STORETIME').getValue();
- var jsonstr = Ext.JSON.encode(query);
- Ext.getCmp('fm_queryJson').setValue(jsonstr);
- form.submit({
- method:'post',
- success: function(form, action) {
- Ext.Msg.alert('操作成功', '已修改', function(btn,txt){
- 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: 350,
- 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_COMPANY_ID').setValue(selected[0].raw.V_COMPANY_NAME);
- Ext.getCmp('fm_V_PHONE').setValue(selected[0].raw.V_PHONE);
- Ext.getCmp('fm_D_START_STORETIME').setValue(selected[0].raw.D_START_STORETIME);
- Ext.getCmp('fm_D_END_STORETIME').setValue(selected[0].raw.D_END_STORETIME);
- Ext.getCmp('fm_UQ_CATEGORY').setValue(selected[0].raw.UQ_CATEGORY);
- Ext.getCmp('fm_I_NUMBER_OF_BARS').setValue(selected[0].raw.I_NUMBER_OF_BARS);
- Ext.getCmp('fm_I_CYCLE').setValue(selected[0].raw.I_CYCLE);
- Ext.getCmp('fm_UQ_SETMREAL_ID').setValue(selected[0].raw.UQ_SETMREAL_ID);
- Ext.getCmp('fm_UQ_SETMREAL_ZB_ID').setValue(selected[0].raw.UQ_SETMREAL_ZB_ID);
- Ext.getCmp('fm_E_STATUS').setValue(selected[0].raw.E_STATUS);
- }else{
- Ext.Msg.alert('请先选择','请先选择一条记录,再点击修改');
- }
- }
-
-
-
-
- var clear_filter_form1 = function(){
- // Ext.getCmp('fc_UQ_SETMREAL_ID').setValue("");
- Ext.getCmp('fc_UQ_SETMREAL_ZB_ID').setValue("");
- // Ext.getCmp('fc_E_STATUS').setValue(-1);
- // 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_SETMREAL_ZB_ID = selected[i].raw.UQ_SETMREAL_ZB_ID;
- list.push(o);
- }
-
- query.UQ_SETMREAL_ZB_ID_LIST = list;
-
- var jsonstr= Ext.JSON.encode(query);
- Ext.MessageBox.confirm('注销','是否注销'+sm.getCount()+'个?',function(btn){
- if(btn=='yes'){
- Ext.Ajax.request( {
- timeout : 3000000,
- url: baseUrl+'iot/outcrypackage/del',
- params : 'queryJson='+ jsonstr,
- success: function(resp,opts){
- myStore.reload();
- }
- });
-
- }
- },this);
- }else{
- Ext.Msg.alert('请先选择','请先选择一条记录,再点击删除');
- }
- }
-
- Ext.create('Ext.grid.Panel', {
- title: '语音报警套餐管理',
- id: 'OutcryPackageListPanel',
- store: myStore,
- selModel: sm,
- columns: [
- { header: 'ID', dataIndex: 'UQ_SETMREAL_ZB_ID',hidden:true, menuDisabled:true },
- { header: 'ID', dataIndex: 'UQ_SETMREAL_ID',hidden:true, menuDisabled:true },
- { header: 'ID', dataIndex: 'UQ_COMPANY_ID',hidden:true, menuDisabled:true },
- { header: '序号', dataIndex: 'I_ORDER_IDX', width:40, menuDisabled:true },
- { header: '单位名称', dataIndex: 'V_COMPANY_NAME', width:240, menuDisabled:true },
- { header: '类别', dataIndex: 'UQ_CATEGORY', width:120, menuDisabled:true },
- { header: '数量', dataIndex: 'I_NUMBER_OF_BARS', width:90, menuDisabled:true },
- { header: '规格', dataIndex: 'I_CYCLE', width:90, menuDisabled:true },
- { header: '当前状态', dataIndex: 'E_STATUS',width:120, align:'center', menuDisabled:true },
- { header: '外呼手机号', dataIndex: 'V_PHONE', width:120, menuDisabled:true },
- { header: '开始日期', dataIndex: 'D_START_STORETIME',width:240, align:'center', menuDisabled:true },
- { header: '结束日期', dataIndex: 'D_END_STORETIME', width:240, 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+'&uqCategory='+rec.get('UQ_CATEGORY')+'&companyId='+rec.get('UQ_CATEGORY');
- // }
- // }]
- // }
- ],
- 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
- }
- }
- ],
- height: maxHeight,
- width: '100%',
- bbar: new Ext.PagingToolbar({
- store: myStore,
- id:'OutcryPackageListPageToolbar',
- 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('OutcryPackageListPanel').setHeight(maxHeight);
-
- });
|