HandTask.js 2.16 KB
layui.config({
    base: "/js/"
}).use(['form', 'element', 'vue', 'layer', 'laydate', 'jquery','hhweb', 'table', 'utils', 'Universal'], function () {
    var form = layui.form,
        layer = layui.layer,
        element = layui.element,
        laydate = layui.laydate,
        $ = layui.jquery,
        table = layui.table,
        Universal = layui.Universal;

    var AreaName = 'HandTask';
    var TableName = 'TaskDetail';

    var vm = new Vue({
        el: '#PalletForm'
    });

    var PalletIn = new Vue({
        data: {}
    });

    var selector = {
    };

    var vml = new Array({
        vm: vm,
    });

    Universal.BindSelector($, form, vml, selector);

    $(document).on("click", "#BtnGo", function () {
        var Stk = $("#Stk  option:selected");
        var Type = $("#Type option:selected");

        layer.open({
            title: '确定信息',
            area: '300px;',
            type: 1,
            content: "<h2 class='c1'>确定选择设备为:</h2><br><h2 class='c3'>" + Stk.text() + "<h2><br><h2  class='c1'>状态选择为:</h2><br><h2 class='c3'>" + Type.text()+"</h2>",
            btn: ['确认'],
            btnAlign: 'c', //按钮居中
            yes: function (index) {
                $.ajax({
                    async: false,
                    url: "/" + "HandTask" + "/" + "HandTask" + "/AbnormalRepair",
                    type: "post",
                    data: { code: Stk.val(), type: Type.val() },
                    dataType: "json",
                    success: function (result) {
                        if (result.Code == 200) {
                            layer.close(index);
                            layer.msg("发送成功", { icon: 6, shade: 0.4, time: 1000 });
                        }
                        else {
                            layer.alert("失败:" + result.Message, { icon: 5, shadeClose: true, title: "错误信息" });
                      }

                    },
                    error: function (XMLHttpRequest, textStatus, errorThrown) {
                        layer.alert(errorThrown, { icon: 2, title: '提示' });
                    }
                });
            }
        });
    });

});