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