自动化立体仓库 - WMS系统
dubin
4 小时以前 0ab29c6d89777a832e21c5d2934e3e3e1544c6d8
src/main/webapp/static/js/mat/mat.js
@@ -5,6 +5,9 @@
    var cols = [
        {type: 'checkbox'}
        ,{field: 'tagId$', align: 'center',title: '归类', templet: '#tagTpl'}
        ,{field: 'store_max', align: 'center',title: '库存上限',hide:true}
        ,{field: 'store_min', align: 'center',title: '库存下限',hide:true}
        ,{field: 'store_max_date', align: 'center',title: '库龄上限(天)',hide:true}
    ];
    cols.push.apply(cols, matCols);
    cols.push(
@@ -234,6 +237,9 @@
            case 'edit':
                showEditModel(data)
                break;
            case 'editBarcode':
                showEditModelBarcode(data)
                break;
        }
    });
@@ -309,6 +315,72 @@
        });
    }
    /* 显示表单弹窗 */
    function showEditModelBarcode(mData) {
        admin.open({
            type: 1,
            area: '600px',
            title: '绑定商品',
            content: $('#editDialogBarcode').html(),
            success: function (layero, dIndex) {
                // 回显表单数据
                form.val('detail', mData);
                // 表单提交事件
                form.on('submit(editSubmit)', function (data) {
                    console.log(data)
                    data.field.tagId = insXmSel.getValue('valueStr');
                    if (isEmpty(data.field.tagId)) {
                        layer.msg('分类不能为空', {icon: 2});
                        return false;
                    }
                    var loadIndex = layer.load(2);
                    $.ajax({
                        url: baseUrl+"/mat/barcode/auth",
                        headers: {'token': localStorage.getItem('token')},
                        data: data.field,
                        method: 'POST',
                        success: function (res) {
                            layer.close(loadIndex);
                            if (res.code === 200){
                                layer.close(dIndex);
                                layer.msg(res.msg, {icon: 1});
                                $(".layui-laypage-btn")[0].click();
                            } else if (res.code === 403){
                                top.location.href = baseUrl+"/";
                            }else {
                                layer.msg(res.msg, {icon: 2});
                            }
                        }
                    })
                    return false;
                });
                // 渲染下拉树
                var insXmSel = xmSelect.render({
                    el: '#tagSelBarcode',
                    height: '250px',
                    data: insTb.options.data,
                    initValue: mData ? [mData.tagId] : [],
                    model: {label: {type: 'text'}},
                    prop: {
                        name: 'name',
                        value: 'id'
                    },
                    radio: true,
                    clickClose: true,
                    tree: {
                        show: true,
                        indent: 15,
                        strict: false,
                        expandedKeys: true
                    }
                });
                // 弹窗不出现滚动条
                $(layero).children('.layui-layer-content').css('overflow', 'visible');
                layui.form.render('select');
            }
        });
    }
    // 模板选择
    form.on('radio(selectTemplateRadio)', function (data) {
        $('.template-preview').hide();