InventoryView.js 2.48 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 = 'task';
    var TableName = 'TaskDetail';

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

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

    var t = 2;

    function mainList() {
            table.reload('mainList', {
                url: "/" + "task" + "/" + "Task" + "/StationToInventory"
                , where: { stationCode: $('[name = "IsShou"]:checked').val() }
                , method: "post"
                , text: { none: "暂无数据!" }
        });
        }

    function time() {
        $('#time').text(t);
        t -= 1;
        if (t < 1) {
            t = 3;
        }
    }

    var selector = {
        'TaskType': {
            SelType: "FromDict",
            SelFrom: "taskType",
            SelModel: "TaskType",
            SelLabel: "DictLabel",
            SelValue: "DictValue",
            Dom: [$("[name='TaskType']")]
        },
        'ContainerStatus': {
            SelType: "FromDict",
            SelFrom: "containerStatus",
            SelModel: "ContainerStatus",
            SelLabel: "DictLabel",
            SelValue: "DictValue",
            Dom: [$("[name='ContainerStatus']")]
        },
        'Type': {
            SelType: "FromDict",
            SelFrom: "containerType",
            SelModel: "Type",
            SelLabel: "DictLabel",
            SelValue: "DictValue",
            Dom: [$("[name='Type']")]
        }
    };

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

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

    //站台选择
    $(document).on("click", "#btnstation", function () {
        layer.open({
            title: '站台选择',
            area: ["800px", "400px"],
            type: 1,
            content: $('#station'),
            btn: ['确认'],
            yes: function (index) {
                $('#btnstation').text($('[name = "IsShou"]:checked').parent().text());
                layer.close(index);
            }
        });
    });

    var time;

    //打开页面聚焦“容器管理”
    $(document).ready(function () {
        window.setInterval(mainList, 3000);
        window.setInterval(time, 1000);
    });


});