$(function() {
	
	for(var i=1;i<=20/0.5;i++){
		var ind=i*0.5;
		$('.timeLimitUl').append('<li value="'+ind+'"><a javascript:void(0) style="padding-left:0.08rem;">'+ind+'</a></li>')
	};
	
	$('.timeLimitUl').on('click','li',function(){
		$('#timeLimitBtn i').text($(this).attr('value')=='0'?'无时限':$(this).attr('value'));
		$('[name=timeLimit]').val($(this).attr('value'))
	});
	
	$('.workingDayUl').on('click','li',function(){
		$('#workingDayBtn i').text($(this).text());
		$('[name=workingDay]').val($(this).attr('value'))
	})
	
	$("#myModal-addprocessNodeInfor .addSure").click(function(){
		$("#setTimeLimitForm").submit();
	});
	
	$("#setTimeLimitForm").validate({
		promptPosition : "bottomLeft",
		submitHandler : function(form) {
			$("#myModal-addprocessNodeInfor .addSure").addClass("loadingCircle");
			$(form).ajaxSubmit({
				success : function(e) {
					if (e && e.success == true) {
						new $.zui.Messager('保存成功', {
							type : 'success'
						}).show();
						$("#myModal-addprocessNodeInfor .addSure").removeClass("loadingCircle");
						$("#myModal-addprocessNodeInfor").modal("hide");
						$("#myModal-addprocessNodeInfor").off('hidden.zui.modal').on('hidden.zui.modal', function(){
							//刷新表格
							$('#processNodeList').trigger('reloadGrid');
						});
					}else {
						new $.zui.Messager('保存失败:'+e.msg, {
							type : 'danger'
						}).show();
						$("#myModal-addprocessNodeInfor .addSure").removeClass("loadingCircle");
					}
				}
			})
		},
		rules : {
			
		},
		messages : {
			
			
		}
	})
})