DateForm = Ext.extend(Ext.ux.Form,{
taskIds:[], //存放批量任务
constructor: function(){
this.dateStart = this.createDateField('<font color="red">*</font>开始日期',
'dateStart','Ymd', '95%');
this.dateEnd = this.createDateField('<font color="red">*</font>结束日期','dateEnd','Ymd', '95%');
// var paramPk =[{'id':'0', 'name':'0'},{'id':'1', 'name':'1'}];
this.paramPk = this.createMemoryCombo('PK值','id','name','95%',paramPk, 'paramPk');//自定义下拉框值
this.paramPk.allowBlank = false;
this.paramPk.store.load();
this.dateStart.setMaxValue(new Date());
this.dateEnd.setMaxValue(new Date());
this.dateStart.on('select',function(e){
var beginTime = taskGrid.dateWindow.dateForm.dateStart.getValue().format("Y-m-d");
taskGrid.dateWindow.dateForm.dateEnd.setMinValue(beginTime);
});
this.dateEnd.on('select',function(e){
var endTime = taskGrid.dateWindow.dateForm.dateEnd.getValue().format("Y-m-d");
taskGrid.dateWindow.dateForm.dateStart.setMaxValue(endTime);
});
this.dateStart.allowBlank = false;
this.dateEnd.allowBlank = false;
DateForm.superclass.constructor.call(this, {
anchor: '90%',
autoHeight:true,
labelWidth: 60,
labelAlign :'right',
frame: true,
bodyStyle:"padding: 3px 3px 0",
layout: 'tableform',
layoutConfig: {columns:3},
items:[
this.dateStart,this.dateEnd,this.paramPk
],
buttonAlign :'center',
buttons: [
{text: '确定', width: 20,iconCls: 'save', hidden: false,handler:this.DateFormClick,scope:this},
{text: '关闭', width: 20,iconCls:'delete', handler: this.onCloseClick, scope: this}
]
});
},
DateFormClick:function(){
// var taskId = this.taskId.getValue();
// var dateStr = this.date_.getValue();
var paramPk = this.paramPk.getValue();
if(this.getForm().isValid()){
this.getForm().submit({
waitMsg: '正在提交数据...',
url: '/etl/task/doEtlTaskSched',
method: 'POST',
params:{taskIds:this.taskIds,paramPk:paramPk},
success: function(form,action){
Ext.MessageBox.alert("系统提示:",BLANKSTR+"添加成功!"+BLANKSTR);
// this.dateWindow().ownerCt.hide();
},
failure: function(form,action){
Ext.MessageBox.alert("系统提示:",BLANKSTR+"添加失败!"+BLANKSTR);
this.getForm().ownerCt.hide();
}
});
}
},
onCloseClick:function(){
this.ownerCt.hide();
}
});
/******************Java后台接收*************************/
@RequestMapping(value = "/doEtlTaskSched", method = RequestMethod.POST)
@ResponseBody
public ResponseData doEtlTaskSched(Integer[] taskIds, String dateStart,String dateEnd,Integer paramPk) {
taskSchedService.doEtlTaskSched(taskIds, dateStart,dateEnd,paramPk);
return ResponseData.SUCCESS_NO_DATA;
}