116 lines
4.0 KiB
HTML
116 lines
4.0 KiB
HTML
|
<html login="false">
|
|||
|
<head>
|
|||
|
<meta charset="UTF-8">
|
|||
|
<title>回收任务中心数据</title>
|
|||
|
</head>
|
|||
|
<body >
|
|||
|
<div widget="toolbar" >
|
|||
|
<a widget="button" iconCls="icon-search" onclick="search()">查询</a>
|
|||
|
<a widget="button" iconCls="icon-enabled" onclick="checkall()">全选</a>
|
|||
|
<a widget="button" iconCls="icon-ok" onclick="deleteTask()" >执行</a>
|
|||
|
<a widget="button" iconCls="icon-exit" onclick="CloseWindow('close')" style="margin-left:20px;">退出</a>
|
|||
|
</div>
|
|||
|
<input widget="datechooser" name="startdate" required label="选择日期" style = "width:200px;"onvaluechanged= "checkDate()" />
|
|||
|
<input widget="datechooser" name="enddate" required label="规则截止日期" style = "width:200px;"/>
|
|||
|
<input widget="edit" name="count" label="回收天数" width="200"/>
|
|||
|
<input widget="edit" name="username" label="坐席名称" width="200" />
|
|||
|
<h4 > <font color="red">请注意:选择时间后,规则将按选择的时间减去5天,删除任务中心中系统分配的任务及手动分配任务</font></h4>
|
|||
|
<div widget="autosize">
|
|||
|
<div widget="datagrid" name="grid" style="width: 100%; height: 100%;" url="rushtasklist/post/manualList" multiSelect="true">
|
|||
|
<div type = "checkcolumn" header ="选择"></div>
|
|||
|
<div type="indexcolumn" width="20" header="序号"></div>
|
|||
|
<div field="taskid" visible="false" ></div>
|
|||
|
<div field="task_name" width="60" header="任务名称"></div>
|
|||
|
<div field="curstate" width="20" header="状态"></div>
|
|||
|
<div field="task_user" width="30" header="指派给"></div>
|
|||
|
<div field="fact_assign_num" width="20" header="分配条数"></div>
|
|||
|
<div field="task_ratio" width="20" header="完成比例" renderer="percentRenderer" multiplyHundred="true"></div>
|
|||
|
<div field="create_date" width="50" align="center" header="创建日期"></div>
|
|||
|
<div field="expect" width="50" header="预计结束日期"></div>
|
|||
|
<div field="finish_date" width="50" header="完成日期"></div>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</body>
|
|||
|
<script type="text/javascript">
|
|||
|
var grid = aos.get('grid');
|
|||
|
function init(){
|
|||
|
aos.get('count').setValue(5);
|
|||
|
}
|
|||
|
function search(){
|
|||
|
var endtime = aos.get('enddate').getValue();
|
|||
|
if(null==endtime||""==endtime){
|
|||
|
aos.alert("请选择截止日期");
|
|||
|
return;
|
|||
|
}
|
|||
|
var params={
|
|||
|
enddate:aos.get('enddate').getValue(),
|
|||
|
username : aos.get('username').getValue()
|
|||
|
};
|
|||
|
grid.load(params);
|
|||
|
}
|
|||
|
//为截止日期赋值
|
|||
|
function checkDate(){
|
|||
|
aos.get('enddate').setValue(getBeforeDate(aos.get('count').getValue()));
|
|||
|
}
|
|||
|
//执行
|
|||
|
function deleteTask(){
|
|||
|
var rows = grid.getSelecteds();
|
|||
|
var data={};
|
|||
|
var taskid ="";
|
|||
|
if(rows.length>0){
|
|||
|
for(var i=0;i<rows.length;i++){
|
|||
|
var obj = rows[i].taskid;
|
|||
|
taskid = taskid + obj+",";
|
|||
|
}
|
|||
|
}
|
|||
|
if(!rows){
|
|||
|
aos.alert('选择至少一行后进行删除!');
|
|||
|
return;
|
|||
|
}
|
|||
|
taskid = taskid.substring(0,taskid.lastIndexOf(","));
|
|||
|
data['taskid']= taskid;
|
|||
|
aos.confirm('确认删除吗?',null,function(action){
|
|||
|
if(action == 'cancel')
|
|||
|
return;
|
|||
|
aos.post({
|
|||
|
url:"rushtasklist/post/deleteTaskById",
|
|||
|
data:data,
|
|||
|
success:function(rtnData){
|
|||
|
aos.alert('删除成功!');
|
|||
|
grid.reload();
|
|||
|
}
|
|||
|
|
|||
|
});
|
|||
|
|
|||
|
});
|
|||
|
|
|||
|
}
|
|||
|
function checkall(){
|
|||
|
grid.selectAll();
|
|||
|
}
|
|||
|
//获取指定日期的前n天
|
|||
|
function getBeforeDate(n){
|
|||
|
var n = n;
|
|||
|
var d = new Date(aos.get('startdate').getValue());
|
|||
|
var year = d.getFullYear();
|
|||
|
var mon=d.getMonth()+1;
|
|||
|
var day=d.getDate();
|
|||
|
if(day <= n){
|
|||
|
if(mon>1) {
|
|||
|
mon=mon-1;
|
|||
|
}
|
|||
|
else {
|
|||
|
year = year-1;
|
|||
|
mon = 12;
|
|||
|
}
|
|||
|
}
|
|||
|
d.setDate(d.getDate()-n);
|
|||
|
year = d.getFullYear();
|
|||
|
mon=d.getMonth()+1;
|
|||
|
day=d.getDate();
|
|||
|
s = year+"-"+(mon<10?('0'+mon):mon)+"-"+(day<10?('0'+day):day);
|
|||
|
return s;
|
|||
|
}
|
|||
|
</script>
|
|||
|
</html>
|