|
|
@ -391,9 +391,9 @@ |
|
|
|
|
|
|
|
|
|
|
|
function task_add() { |
|
|
|
function task_add() { |
|
|
|
var task_type = $('[name="task_type"]:checked').val(); |
|
|
|
var task_type = $('[name="task_type"]:checked').val(); |
|
|
|
if (task_type == 5 || task_type == 2) { |
|
|
|
if (task_type == 5 || task_type == 2 || task_type == 1) { |
|
|
|
var name = task_type == 5 ? $('#original_filename').val() : $('#queue-name').val(); |
|
|
|
var name = task_type == 2 ? $('#queue-name').val() : $('#original_filename').val(); |
|
|
|
var type = task_type == 5 ? 'update' : 'export'; |
|
|
|
var type = task_type == 2 ? 'export' : 'update'; |
|
|
|
$.get('{:url("task/checkIsExistName")}?name=' + name + '&type=' + type, function (ret) { |
|
|
|
$.get('{:url("task/checkIsExistName")}?name=' + name + '&type=' + type, function (ret) { |
|
|
|
if (ret.code == 1) { |
|
|
|
if (ret.code == 1) { |
|
|
|
layer.confirm(ret.msg, function (index) { |
|
|
|
layer.confirm(ret.msg, function (index) { |
|
|
@ -403,17 +403,25 @@ |
|
|
|
}else if (ret.code == 0) { |
|
|
|
}else if (ret.code == 0) { |
|
|
|
layer.alert(ret.msg); |
|
|
|
layer.alert(ret.msg); |
|
|
|
}else if (ret.code == 2) { |
|
|
|
}else if (ret.code == 2) { |
|
|
|
|
|
|
|
layer.confirm('确认并继续', function (index) { |
|
|
|
|
|
|
|
layer.close(index); |
|
|
|
submitForm(); |
|
|
|
submitForm(); |
|
|
|
|
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
}else { |
|
|
|
}else { |
|
|
|
|
|
|
|
layer.confirm('确认并继续', function (index) { |
|
|
|
|
|
|
|
layer.close(index); |
|
|
|
submitForm(); |
|
|
|
submitForm(); |
|
|
|
|
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function submitForm(){ |
|
|
|
function submitForm(){ |
|
|
|
$.post('{:url("task/save")}', $('#task-model-add').find('.active :input').serialize(), function (ret) { |
|
|
|
$.post('{:url("task/save")}', $('#task-model-add').find('.active :input').serialize(), function (ret) { |
|
|
|
if(ret.code == 0){ |
|
|
|
if(ret.code == 0){ |
|
|
|
|
|
|
|
$('#original_filename').val(''); |
|
|
|
|
|
|
|
$('#filename').val(''); |
|
|
|
layer.alert(ret.msg); |
|
|
|
layer.alert(ret.msg); |
|
|
|
}else { |
|
|
|
}else { |
|
|
|
layer.msg(ret['msg'],function(){ |
|
|
|
layer.msg(ret['msg'],function(){ |
|
|
|