InventoryView.js 2.82 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 mainList = {
        //NoData: function () {
        //    return "<div id='background' style='width:100%;height:100%;background-image:url(../../images/NoData.png);background-repeat:no-repeat;background-size:cover;'>.</div>"
        //},
        mainList: function (vm) {
            table.reload('mainList', {
                url: "/" + "task" + "/" + "Task" + "/StationToInventory"
                , where: { stationCode: vm }
                , method: "post"
                , text: { none: "暂无数据,请扫码容器编号!" }
                // , text: { none: this.NoData() }
            });
        }
    };

    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 () {
        time = setInterval(mainList.mainList($('[name = "IsShou"]:checked').val()),5000);
    });

    $('[name = "IsShou"]').change(function () {
        clearInterval(time);
        time = setInterval(mainList.mainList($('[name = "IsShou"]:checked').val()),5000);
    });
});