var edit_id = helper.request.queryString("oid");
$(function() {
		
			
			$('#save_order').click((function(){
				addedit(edit_id)
			}))
			

		
});

function addedit(editId) {
	// alert(edit_id);
		$.post(huayi.config.callcenter_url + "WorkOrderNew/DelayWorkOrder", {
					orderid:editId,
					cont: $("#yuanyin").val(),//延期原因
					// F_CustomerCode: $('#customer_code').val(),
					limit: $('#order_isover').find('input[type="radio"]:checked').val(), //时间
					token: $.cookie("token")
			}, function(result) {
				result = $.parseJSON(result);
				if(result.state.toLowerCase() == "success") {
					 var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
					 parent.layer.close(index); //再执行关闭
					 parent.$('#cusList').bootstrapTable('refresh');						
					 parent.layer.msg("申请延期成功");
					 top.workcount();
				}
			})
}

// 关闭 - 申请延期
function close_win() {
    $("#yuanyin").val("");
    var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
    parent.layer.close(index); //再执行关闭
}


$('#order_isover').find('input[type="radio"]').on('change', function() {
			if($(this).val() == "11") { //业务办理
				$('#show').show();
			}else{
				$('#show').hide();
			}
		});