Index: ssts-web/src/main/webapp/disinfectsystem/recyclingApplication/goodsTemplateApplicationView.js =================================================================== diff -u -r14776 -r14812 --- ssts-web/src/main/webapp/disinfectsystem/recyclingApplication/goodsTemplateApplicationView.js (.../goodsTemplateApplicationView.js) (revision 14776) +++ ssts-web/src/main/webapp/disinfectsystem/recyclingApplication/goodsTemplateApplicationView.js (.../goodsTemplateApplicationView.js) (revision 14812) @@ -3129,25 +3129,20 @@ }); /** - * 设置自定义过滤条件,用于快速条件筛选, - * 里面通过重写getGridParameterMap,来自定义添加过滤的参数 - * @param mapVal 要设定的值,里面是一个数组 - * @param field 对应的参数名字 + * 设置自定义过滤条件,用于状态筛选筛选, + * @param field 对应的参数key */ - function reloadFilterPara(mapVal,field) { - Ext.ux.ForgonPageGrid.prototype.getGridParameterMap = function() { - var gridParameterMap = {}; - if (field == 'all'){ - return gridParameterMap; - } - if (field.indexOf("deliver") != -1 ){ - gridParameterMap.grid_filter_deliverStatus_list_ = mapVal; - } - else if (field.indexOf("recycling") != -1){ - gridParameterMap.grid_filter_recyclingStatus_list_ = mapVal; - } - return gridParameterMap; - }; + function reloadFilterPara(field) { + var parm_s_status = document.getElementById('parm_s_status'); + if (field == 'all'){ + parm_s_status.value = ''; + } + else if (field == 'unFinish' ){ + parm_s_status.value = 'unFinish'; + } + else if (field == 'finish'){ + parm_s_status.value = 'finish'; + } // grid.getStore().reload(); grid.dwrReload(); } @@ -3162,38 +3157,53 @@ grid.dwrReload(); } - //快速筛选combo Store + function reloadTimeField(){ + var startDate = Ext.getCmp("startDate").getValue(); + var endDate = Ext.getCmp("endDate").getValue(); + if (isUndefinedOrNullOrEmpty(startDate) || isUndefinedOrNullOrEmpty(endDate)){ + Ext.Msg.alert('警告', '日期不能为空!'); + return; + } + var value1 = Date.parse(startDate); + var value2 = Date.parse(endDate); + if (value1 > value2) { + Ext.Msg.alert('警告', '开始日期不能大于结束日期!'); + return; + } + document.getElementById('parm_s_startTime').value = value1; + document.getElementById('parm_s_endTime').value = value2; + grid.dwrReload(); + } + + + //状态筛选combo Store var quickScreenStatus = new Ext.data.SimpleStore({ fields: ['key', 'val'], data: [ - ['all', '全部'], - ['recycling_awaitRecycle', '待回收'], - ['recycling_partRecycle','部分回收'], - ['recycling_recycled','已回收'], - ['deliver_awaitDeliver','待发货'], - ['deliver_partDelivered','部分发货'], - ['deliver_delivered','已发货'] + ['unFinish', '未完成'], + ['finish', '已完成'], + ['all', '全部'] ] }); - //快速筛选combo + //状态筛选combo var quickScreenCombo = { xtype: 'combo', - fieldLabel: '快速筛选', + fieldLabel: '状态筛选', store: quickScreenStatus, width: 80, mode: 'local', triggerAction: 'all', displayField: 'val', forceSelection: true, - value: '全部', + value: '未完成', editable: false, listeners : { select : function(combo, record, index){ var key = record.get('key'); - var val = record.get('val'); - var array = [val]; - reloadFilterPara(array,key); + // var val = record.get('val'); + // var array = [val]; + reloadFilterPara(key); } } }; @@ -3413,11 +3423,41 @@ updatePrintState(grid); } },{ - text : '快速筛选:' + text : '状态筛选:' }, - quickScreenCombo,{ - text : '时间筛选:' - },submitTimeCombo, + quickScreenCombo, + // { text : '时间筛选:'},submitTimeCombo, + { + text : '开始日期:' + }, { + xtype : 'datefield', + fieldLabel : '开始日期', + name : 'startDate', + id : 'startDate', + readOnly : false, + editable : false, + altFormats:'Y-m-d|Y-n-j|y-n-j|y-m-j|y-m-d|y-n-d|Y-n-d|Y-m-j|Ymd|Ynj|ynj|ymj|ymd|ynd|Ynd|Ymj|Y/m/d|Y/n/j|y/n/j|y/m/j|y/m/d|y/n/d|Y/n/d|Y/m/j', + format : 'Y-m-d', + width:100 + }, { + text : '结束日期:' + }, { + xtype : 'datefield', + fieldLabel : '结束日期', + name : 'endDate', + id : 'endDate', + readOnly : false, + editable : false, + altFormats:'Y-m-d|Y-n-j|y-n-j|y-m-j|y-m-d|y-n-d|Y-n-d|Y-m-j|Ymd|Ynj|ynj|ymj|ymd|ynd|Ynd|Ymj|Y/m/d|Y/n/j|y/n/j|y/m/j|y/m/d|y/n/d|Y/n/d|Y/m/j', + format : 'Y-m-d', + width:100 + },{ + xtype : 'button', + text : '查询', + // iconCls : 'btn_ext_application_search', + iconCls : 'icon_search', + handler : reloadTimeField + }, '->',{ //加->表示往右居中 text : '全部申请单', @@ -3453,6 +3493,12 @@ null ); + + //设置开始时间为服务器当天当月第一天 + getFirstDay('yyyy-MM-dd',Ext,'startDate'); + //设置结束时间为服务器当天时间 + getServerTime('yyyy-MM-dd',Ext,'endDate'); + var tableContent; grid.on('mouseover', function(e) {// 添加mouseover事件 var index = grid.getView().findRowIndex(e.getTarget());// 根据mouse所在的target可以取到列的位置 @@ -3565,4 +3611,30 @@ + /** + * 获取当月第一天 + * @param format 日期格式(按java的来写) + * @param extObj 对应的extJs对象 + * @param fieldId 区域的id + */ + function getFirstDay(format,extObj,fieldId) { + extObj.Ajax.request({ + url : WWWROOT + '/system/serverTimeAction!getFirstDay.do', + params : {dateFormat : format}, + success : function(response, options) { + var result = extObj.decode(response.responseText); + if(result.success){ + var resultTime = result.message; + extObj.getCmp(fieldId).setValue(resultTime); + } + else{ + alert(result.message); + } + }, + failure : function(response, options) { + alert('获取服务器时间失败'); + } + }); + } + }); \ No newline at end of file