

var layer_index;
function addUser(title, id) {
    $("#jswintitle").html(title);
    layer_index = layer.open({
        type: 1,
        title: false,
        closeBtn: 0,
        shift: false,
        content: $("#jsAddUser"),
    });
    $("#id").val(id);
    //如果是新增
    if (id == "0")
    {
       // $("#fvdxsm").val("无");
    }
    else
    {//是修改，调用getuser()
        getuser(id);
    }
}
//AJAX读取周名称信息
function getuser(id) {

    var1 = "beduajax.aspx?ACT=814D0918D52AC0B1147DA0082048C582&id=" + id;

    var1 = encodeURI((var1));
    $.ajax({
        type: "Post",
        url: var1,
        data: { data1: '13D17C93EDB', },
        cache: false,
        contentType: "application/x-www-form-urlencoded; charset=UTF-8",
        success: function (temptext) {
            var arr = new Array();
            arr = temptext.split("|");
          
            $("#fitsxh").val(arr[0]);
            $("#fvtszm").val(arr[1]);
        }
    });
     

}


//关闭弹出
function cansleAdd() {
    layer.close(layer_index);
    clearWin();
}
//清除窗体中内容
function clearWin() {
    $("#jsAddUser").find("input").each(function () {
        $(this).val("");
    });
}

//发送AJAX
function Zsend(var1) {

    temptext = var1;
    layer.msg(temptext, { icon: 1, btn: ['确定'] }, function () {
        if (temptext.indexOf("成功") > -1) {
            window.location.reload();
        }
        if (temptext.indexOf("相同周序号") > -1) {
            $("input[name='fitsxh']").get(index).select();
            $("input[name='fitsxh']").get(index).focus();

        }
        return true;
    });
}
function ZDELESELE(id) {
    layer.confirm('确认要删除吗？', {
        icon: 3, btn: ['确定', '取消'] //按钮
    }, function () {
        temp = ZQDdele(id);
    });
}

function ZQDdele(id) {//删除
    var1 = "beduajax.aspx?ACT=C04F7376AE7CF6920D2747A5242F272A&id=" + id;
    var temptext = "";
    var1 = encodeURI((var1));
    $.ajax({
        type: "Post",
        url: var1,
        data: { data1: '13D17C93EDB', },
        cache: false,
        contentType: "application/x-www-form-urlencoded; charset=UTF-8",
        success: function (temptext) {
            layer.msg(temptext, { icon: 1, btn: ['确定'] }, function () {
                if (temptext.indexOf("成功删除周名称") > -1) {
                    window.location.reload();
                }
                return true;
            });
        }
    });
}

