TTaskLift.js 2.44 KB
layui.config({
    base: "/js/"
}).use(['form', 'I18nPage', 'element', 'vue', 'layer', 'jquery', 'hhweb'], function () {
    var form = layui.form,
        layer = layui.layer,
        element = layui.element,
        $ = layui.jquery,
        hhweb = layui.hhweb,
        I18nPage = layui.I18nPage;

    var AreaName = 'task';
    var TableName = 'TTaskLift';

    var Lang = I18nPage.GetLang();
    var MessageContainer = {};
    I18nPage.GetI18nMessage({
        Type: "PM",
        Code: "TTaskLift",
        Container: MessageContainer,
    });

    I18nPage.GetI18nText({
        Type: "LP",
        Code: "TTaskLift",
    });

    if (Lang == "cn") {
        $($(':radio[name="LiftNo"]')[0]).attr("title","W1区入库");
        $($(':radio[name="LiftNo"]')[1]).attr("title","C1区");
        $($(':radio[name="LiftNo"]')[2]).attr("title", "W1区备料");  
    }
    else {
        $($(':radio[name="LiftNo"]')[0]).attr("title","W1 Area In");
        $($(':radio[name="LiftNo"]')[1]).attr("title","C1 Area");
        $($(':radio[name="LiftNo"]')[2]).attr("title", "W1 Area Out");
    }
    $($(':radio[name="LiftNo"]')[0]).attr("value", "172.29.176.11");
    $($(':radio[name="LiftNo"]')[1]).attr("value", "172.29.194.159");
    $($(':radio[name="LiftNo"]')[2]).attr("value", "172.29.176.10");
    form.render()

    $("#SendTask").on('click', function () {
        var liftNo = $(':radio[name="LiftNo"]:checked').val();
        if (liftNo == undefined || liftNo == "") {
            layer.alert(MessageContainer["LiftNoNotSelect"], { icon: 5, shadeClose: true, title: MessageContainer["ErrorInfo"] });
            return;
        }
        var index = layer.load();
        $.ajax({
            url: "/" + AreaName + "/" + TableName + "/LiftChange",
            type: "post",
            data: { liftNo: liftNo },
            dataType: "json",
            success: function (result) {
                layer.close(index);
                if (result.Code == 200 && result.Status) {
                    layer.msg(MessageContainer["Success"]);
                }
                else {
                    layer.alert(result.Message, { icon: 5, shadeClose: true, title: MessageContainer["ErrorInfo"] });
                }
            },
            error: function (XMLHttpRequest, textStatus, errorThrown) {
                layer.close(index);
                layer.alert(errorThrown, { icon: 2, shadeClose: true, title: MessageContainer["ErrorInfo"] });
            }
        });
    });
});