自动化立体仓库 - WMS系统
zyx
2024-01-08 71d838e032d13a46a07917f5606862496220ea74
src/main/webapp/static/js/pla/productionInfo.js
@@ -18,6 +18,7 @@
        ,{field: 'line', align: 'center',title: '生产线', edit: true}
        ,{field: 'packageType', align: 'center',title: '包装类型', edit: true}
        ,{field: 'zpalletType', align: 'center',title: '托盘类型', edit: true}
        ,{field: 'filmWrap', align: 'center',title: '缠膜', edit: true}
    ];
    return cols;
}
@@ -32,6 +33,8 @@
    var form = layui.form;
    var admin = layui.admin;
    initSelector();
    tableIns = table.render({
        elem: '#productionInfoTable',
        data: [],
@@ -45,6 +48,46 @@
        }
    });
    function initSelector(){
        $('#package').append('<option value="value">Text</option>');
        var selectDom = $('#package');
        $.ajax({
            url: baseUrl+"/configTypeQuery/auth",
            headers: {'token': localStorage.getItem('token')},
            data: {condition: ',packageType'},
            method: 'POST',
            traditional:true,
            success: function (res) {
                if (res.code === 200){
                    var list = res.data;
                    for (var i=0;i<list.length;i++){
                        var option = new Option(list[i].value, i);
                        selectDom.append($("<option></option>").attr("value",option["value"]));
                    }
                } else if (res.code === 403){
                }else {
                    layer.msg(res.msg, {icon: 2})
                }
            }
        })
        $('#packageCheck').val();
    }
    form.on('select(selectDemo1)', function (data) {
        debugger
        console.log(data.elem);
        var elem = $(data.elem);
        var trElem = elem.parents('tr');
        console.log(trElem);
        var tableData = table.cache.productionInfoTable; // 为table id
        console.log(tableData);
        // 更新到表格的缓存数据中,才能在获得选中行等等其他的方法中得到更新之后的值
        tableData[trElem.data('index')][elem.attr('name')] = data.value;
    });
    // 重置事件
    form.on('submit(reset)', function (data) {
@@ -62,7 +105,6 @@
    function tableReload() {
        tableIns.reload({data: matCodeData});
    }
    $(document).on('click','#add', function () {