日期:2014-05-18 浏览次数:20644 次
function insertWorkPlan(obj){
if(button_onsubmit()){
var trobj=j$(obj).parent().parent();
var programName=j$(trobj).find("select[name=programName]").val();
var workTime=j$(trobj).find(":input[name=workTime]").val();
var workBreak=j$(trobj).find(":input[name=workBreak]").val();
var workDiscretion=j$(trobj).find(":input[name=workDiscretion]").val();
var finishDate=j$(trobj).find(":input[name=finishDate]").val();
var finishStatue=j$(trobj).find("select[name=finishStatue]").val();
var headPepole=j$(trobj).find(":input[name=headPepole]").val();
var remark=j$(trobj).find(":input[name=remark]").val();
var coordinationObject=j$(trobj).find(":input[name=coordinationObject]").val();
var superviseTime=j$(trobj).find(":input[name=superviseTime]").val();
var taskType=j$(trobj).find("select[name=taskType]").val();
var myworkplan =programName+","+workTime+","+workBreak+","+workDiscretion+","+finishDate+","
+finishStatue+","+headPepole+","+remark+","+coordinationObject+","+superviseTime+","+taskType;
//DWREngine.setAsync(false);
WorkPlanProxy.insertWorkPlan(myworkplan,function(data){workBack(data,obj,myworkplan);});
//DWREngine.setAsync(true);
}
}
function workBack(data,obj,myworkplan){
alert(data+"===");
var trobj=j$(obj).parent().parent();
var datas=myworkplan.spilt(",");
j$(trobj).empty();
j$(trobj).html(
'<td>'+datas[0]+'</td><td>'+datas[1]+'</td><td>'+datas[2]+'</td><td>'+
datas[3]+'</td><td>'+datas[4]+'</td><td>'+datas[5]+'</td><td>'+datas[6]+'</td>'+
'<td>'+datas[7]+'</td><td>'+datas[8]+'</td><td>'+datas[9]+'</td><td>'+datas[10]+'</td>'+
'<td>'+ '<a href="#" onclick="updateWorkPlan(this)">修改</a> <a href="#" onclick="deleteWorkPlan(this)">删除</a>'+
'</td>'
);
}