}
if (currentStep == 0) {
alert('请选择一项!');
return false;
}
if (confirm("确定要删除改记录吗?")) {
$("#content tr").each(function () {
var seq = parseInt($(this).children("td").html());
if (seq == currentStep) { $(this).remove(); }
if (seq > currentStep) { $(this).children("td").each(function (i) { if (i == 0) $(this).html(seq - 1); }); }
});
}
}
//上移
function up_exchange_line(index) {
if (index != null) {
currentStep = $(index).parent().parent().find("td:first-child").html();
}
if (currentStep == 0) {
alert('请选择一项!');
return false;
}
if (currentStep <= 1) {
alert('已经是最顶项了!');
return false;
}
var upStep = currentStep - 1;
//修改序号
$('#line' + upStep + " td:first-child").html(currentStep);
$('#line' + currentStep + " td:first-child").html(upStep);
//取得两行的内容
var upContent = $('#line' + upStep).html();
var currentContent = $('#line' + currentStep).html();
$('#line' + upStep).html(currentContent);
//交换当前行与上一行内容
$('#line' + currentStep).html(upContent);
$('#content tr').each(function () { $(this).css("background-color", "#ffffff"); });
$('#line' + upStep).css("background-color", "yellow");
event.stopPropagation(); //阻止事件冒泡
}
//下移
function down_exchange_line(index) {
if (index != null) {
currentStep = $(index).parent().parent().find("td:first-child").html();
}
if (currentStep == 0) {
alert('请选择一项!');
return false;
}
if (currentStep >= max_line_num) {
alert('已经是最后一项了!');
return false;
}
var nextStep = parseInt(currentStep) + 1;
//修改序号
$('#line' + nextStep + " td:first-child").html(currentStep);
$('#line' + currentStep + " td:first-child").html(nextStep);
//取得两行的内容
var nextContent = $('#line' + nextStep).html();
var currentContent = $('#line' + currentStep).html();
//交换当前行与上一行内容
$('#line' + nextStep).html(currentContent);
$('#line' + currentStep).html(nextContent);
$('#content tr').each(function () { $(this).css("background-color", "#ffffff"); });
$('#line' + nextStep).css("background-color", "yellow");
event.stopPropagation(); //阻止事件冒泡
}
//保存数据
function SaveData() {
var data = "<root>";
$('#content tr').each(function () {
data += "<item>";
var stepName = $(this).find("td:eq(1)").find("input").val();
var stepDescription = $(this).find("td:eq(2)").find("input").val();










