Index: ssts-web/src/main/webapp/disinfectsystem/basedatamanager/departmentgroup/departmentgroupCommonView.js =================================================================== diff -u -r29963 -r29965 --- ssts-web/src/main/webapp/disinfectsystem/basedatamanager/departmentgroup/departmentgroupCommonView.js (.../departmentgroupCommonView.js) (revision 29963) +++ ssts-web/src/main/webapp/disinfectsystem/basedatamanager/departmentgroup/departmentgroupCommonView.js (.../departmentgroupCommonView.js) (revision 29965) @@ -5,6 +5,22 @@ editConfig(data.id); } +//根据科室或者名称过滤 +function search(listStore) { + var searchColumns = ''; + Ext4.getCmp('searchMenu').items.each(function (item) { + if (item.checked) { + searchColumns += item.name + ';'; + } + }); + searchColumns = searchColumns.substring(0, searchColumns.length - 1); + listStore.proxy.extraParams.searchKeyWord = Ext4.getCmp('searchKeyWord').getValue(); + listStore.proxy.extraParams.searchColumns = searchColumns; + listStore.loadPage(1); + listStore.reload(); + Ext4.getCmp('searchKeyWord').setValue(''); +} + Ext4.onReady(function () { Ext4.QuickTips.init(); var columns = [ @@ -24,25 +40,65 @@ handler: function () { deleteConfig(departGroupGrid); } + }, '->', { + width: 70, + text: '搜索列', + id: 'searchButton', + menu: { + id: 'searchMenu', + items: [{ + xtype: 'menucheckitem', + name: 'name', + checked: true, + text: '名称' + }, { + xtype: 'menucheckitem', + name: 'orgUnitNames', + checked: true, + text: '科室名称' + }] + }, + listeners: { + focus: function (thisButton, The, eOpts) { + Ext4.getCmp('searchKeyWord').focus(); + } + } + }, { + xtype: 'textfield', + name: 'searchKeyWord', + id: 'searchKeyWord', + enableKeyEvents: true, + listeners: { + keydown: function (thisTextfield, e, eOpts) { + if (e.keyCode == 13) { + search(listStore); + } + } + } + }, { + text: '搜索', + handler: function (thisButton) { + search(listStore); + } }]; - Ext4.define('departGroupModel', { - extend: 'Ext4.data.Model', - fields: ['id', 'name', 'orgUnitNames'] - }); - - listStore = new Ext4.data.Store({ + listStore = new Ext4.data.JsonStore({ proxy: { type: 'ajax', url: WWWROOT + '/disinfectSystem/orgUnitGroupAction!findOrgUnitGroupList.do', reader: { root: 'data' - } + }, + extraParams: {} }, - model: 'departGroupModel' + fields: [ + { name: 'id' }, + { name: 'name' }, + { name: 'orgUnitNames' } + ] }); - listStore.load(); + listStore.loadPage(1); departGroupGrid = new Ext4.grid.GridPanel({ title: '科室分组设置',