zjj
2024-04-03 52c94f01b291968f331fc0d2def2f7dd885609cb
src/main/webapp/views/pda/locNormalIn.html
@@ -96,17 +96,24 @@
        </div>
    </div>
<!--    <div style="margin: 5px 5px">-->
<!--        <button id="mat-btn" type="button" class="layui-btn layui-btn-normal" onclick="getMat()"><i-->
<!--                class="layui-icon">+</i>提取-->
<!--        </button>-->
<!--    </div>-->
    <!--<div style="margin: 5px 5px">-->
        <!--<button id="mat-btn" type="button" class="layui-btn layui-btn-normal" onclick="getMat()"><i-->
        <!--        class="layui-icon">+</i>提取-->
        <!--</button>-->
    <!--</div>-->
</header>
<!-- 主体 -->
<main>
    <div class="layui-btn-group demoTable">
        <div class="layui-inline">
            <input class="layui-input" name="id" id="demoReload" autocomplete="off" placeholder="生产单号">
        </div>
        <button class="layui-btn" data-type="reload">搜索</button>
        <button class="layui-btn" data-type="getCheckData">提取</button>
    </div>
    <table class="layui-table" id="chooseData" lay-filter="chooseData"></table>
</main>
<!-- 尾部 -->
<footer>
    <div class="layui-btn-container">
@@ -183,6 +190,21 @@
        var layer = layui.layer;
        var form = layui.form;
        var $$ = layui.$, active = {
            getCheckData: function(){ //获取选中数据
                var checkStatus = table.checkStatus('chooseData')
                    ,data = checkStatus.data;
                matData = data
                tableIns.reload({data: matData});
            },
            reload: function () {
                findMata();
            }
        };
        $$('.demoTable .layui-btn').on('click', function(){
            var type = $(this).data('type');
            active[type] ? active[type].call(this) : '';
        });
        document.getElementById("billNo").focus();
        tableIns = table.render({
@@ -192,6 +214,7 @@
            limit: 500,
            cellMinWidth: 50,
            cols: [[
                {type: 'checkbox'},
                {field: 'matNo', align: 'center', title: '物料编码', event: 'modify'},
                {field: 'mnemonic', align: 'center', title: '生产单号', event: 'modify'},
                {field: 'count', align: 'center', title: '数量', style: 'color: blue', width: 50, event: 'modify'},
@@ -225,6 +248,7 @@
            }
        });
        var areaType = getQueryVariable('areaType');
        // 获取仓库下拉
        $.ajax({
@@ -249,6 +273,7 @@
            }
        });
    });
    /*************************************  数量  ****************************************/
    var countDom = $('#count');
@@ -457,7 +482,49 @@
            url: baseUrl + "/mobile/bill/query/auth",
            headers: {'token': localStorage.getItem('token')},
            data: {
                billNo: billNo
                billNo: billNo,
                mnemonic: '',
            },
            method: 'POST',
            success: function (res) {
                if (res.code === 200) {
                    if (res.data != null) {
                        console.log('单号数据', res.data);
                        var data = res.data;
                        if (data.length > 0) {
                            for (var i = 0; i < data.length; i++) {
                                addTableData(data[i]);
                            }
                        }
                    }
                } else if (res.code === 403) {
                    top.location.href = baseUrl + "/pda";
                } else {
                    tips(res.msg, true)
                }
            }
        });
    }
    function findMata() {
        var billNo = $('#billNo').val()
        if (isEmpty(billNo)) {
            return;
        }
        if (billNo.indexOf('=') > -1) {
            billNo = billNo.split(",")[0].split("=")[1];
        }
        var mnemonic = $('#demoReload').val();
        // 赋值前清空表格
        matData = [];
        tableIns.reload({data: matData});
        console.log(billNo)
        console.log(mnemonic)
        $.ajax({
            url: baseUrl + "/mobile/bill/query/auth",
            headers: {'token': localStorage.getItem('token')},
            data: {
                billNo: billNo,
                mnemonic: mnemonic,
            },
            method: 'POST',
            success: function (res) {
@@ -513,6 +580,7 @@
        layer.closeAll();
        $("#billNo").val("");
        $("#uuid").val("");
        $("#demoReload").val("");
        layui.form.render('select');
    }
</script>