Index: ssts-web/src/main/webapp/disinfectsystem/interfere/interfereGoodsApplicationView.js =================================================================== diff -u -r13381 -r20727 --- ssts-web/src/main/webapp/disinfectsystem/interfere/interfereGoodsApplicationView.js (.../interfereGoodsApplicationView.js) (revision 13381) +++ ssts-web/src/main/webapp/disinfectsystem/interfere/interfereGoodsApplicationView.js (.../interfereGoodsApplicationView.js) (revision 20727) @@ -1,5 +1,86 @@ var entityName = "申请"; var grid; + +/** + * 干预申请单的申请时间. + */ +function interfereApplicationTime(ids, applicationTime){ + var window = null; + var formPanel = null; + + formPanel = new top.Ext.FormPanel({ + frame : true, + labelSeparator : ':', + bodyStyle : 'padding:5px 5px 0px 5px', + width : 300, + height : 100, + labelAlign : 'right', + buttonAlign : 'center', + items : [{ + xtype : 'datefieldWithMin', + fieldLabel : '申请时间', + id : 'applicationTime', + name : 'applicationTime', + editable : false, + value: applicationTime, + format : 'Y-m-d H:i', + 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', + allowBlank : false, + anchor : '95%' + }], + buttons : [{ + id : 'saveBtn', + text : '保存', + handler : function(){ + var saveBtn = top.Ext.getCmp('saveBtn'); + if (!formPanel.getForm().isValid()) { + showResult('请正确填写表单值'); + return false; + } + saveBtn.disable(); + + formPanel.getForm().submit({ + url : WWWROOT + '/disinfectSystem/recyclingApplicationAction!interfereApplicationTime.do', + method : 'POST', + waitMsg : '正在保存数据,请稍候', + waitTitle : '提交表单', + params : {ids : ids , applicationTime : Ext.util.Format.date(top.Ext.getCmp('applicationTime').getValue(), 'Y-m-d H:i:s')}, + success : function(form, action) { + var result = Ext.decode(action.response.responseText); + showResult(result.message); + window.close(); + grid.dwrReload(); + }, + failure : function(form, action) { + var result = Ext.decode(action.response.responseText); + showResult(result.message); + saveBtn.enable(); + } + }); + } + }, { + text : '取消', + id : 'saveAndNewBtn', + handler : function() { + window.close(); + } + }] + }); + + window = new top.Ext.Window({ + id : 'problemWin', + layout : 'fit', + title : '干预申请时间', + modal : true, + autoHeight : true, + border : false, + plain : true, + items : [formPanel] + }); + + window.show(); +} + Ext.onReady(function() { Ext.QuickTips.init(); @@ -163,11 +244,36 @@ {type: 'string', dataIndex: 'remark'} ] }); - var tbar = []; grid = new Ext.ux.ForgonPageGrid({ title : entityName + '单列表', - tbar : tbar, + tbar : [{ + text : '干预申请时间', + iconCls : 'btn_ext_application_add', + handler : function() { + var ids = []; + var applicationTime = null; + var selectionModel = grid.getSelectionModel(); + var flag = 1; + selectionModel.each(function(row){ + if (flag == 1) { + applicationTime = row.data.applicationTime; + if (applicationTime.length > 16) { + applicationTime = applicationTime.substring(0, 16); + } + flag ++; + } + ids.push(row.data.id); + }); + + if(ids.length > 0){ + interfereApplicationTime(ids.join(','), applicationTime); + }else{ + showResult("未选中任何记录!"); + return; + } + } + }], pageSize : 20, defaultSortField : 'submitTime', defaultSortDirection : 'DESC',