#
luxiaotao1123
2021-04-09 b0b2378ee01defd753805f21851849659038770c
src/main/webapp/static/js/order/order.js
@@ -48,8 +48,8 @@
    });
    /* 表格搜索 */
    form.on('submit(docTypeTable)', function (data) {
        insTb.reload({where: data.field});
    form.on('submit(docTypeTableSearch)', function (data) {
        insTb.reload({where: {doc_name: data.field.docName}});
        return false;
    });
@@ -76,27 +76,31 @@
        admin.open({
            type: 1,
            title: (mData ? '修改' : '添加') + '字典',
            content: $('#dictEditDialog').html(),
            content: $('#docTypeEditDialog').html(),
            success: function (layero, dIndex) {
                // 回显表单数据
                form.val('dictEditForm', mData);
                form.val('docTypeEditForm', mData);
                // 表单提交事件
                form.on('submit(dictEditSubmit)', function (data) {
                form.on('submit(docTypeEditSubmit)', function (data) {
                    var loadIndex = layer.load(2);
                    $.get(mData ? '../../json/ok.json' : '../../json/ok.json', data.field, function (res) {
                    $.ajax({
                        url: baseUrl+"/docType/"+(mData?'update':'add')+"/auth",
                        headers: {'token': localStorage.getItem('token')},
                        data: data.field,
                        method: 'POST',
                        success: function (res) {
                        layer.close(loadIndex);
                        if (200 === res.code) {
                            if (res.code === 200){
                            layer.close(dIndex);
                            layer.msg(res.msg, {icon: 1});
                            if (obj) {
                                obj.update(data.field);
                            } else {
                                insTb.reload();
                            }
                            } else if (res.code === 403){
                                top.location.href = baseUrl+"/";
                        } else {
                            layer.msg(res.msg, {icon: 2});
                        }
                    }, 'json');
                        }
                    })
                    return false;
                });
            }
@@ -111,18 +115,24 @@
        }, function (i) {
            layer.close(i);
            var loadIndex = layer.load(2);
            $.get('../../json/ok.json', {
                id: obj.data.dictId,
            }, function (res) {
            $.ajax({
                url: baseUrl+"/docType/delete/one/auth",
                headers: {'token': localStorage.getItem('token')},
                data: {param: JSON.stringify(obj.data)},
                method: 'POST',
                success: function (res) {
                layer.close(loadIndex);
                if (200 === res.code) {
                    layer.msg(res.msg, {icon: 1});
                    obj.del();
                    if (res.code === 200){
                        layer.closeAll();
                        insTb.reload();
                    $('#dictTable+.layui-table-view .layui-table-body tbody>tr:first').trigger('click');
                    } else if (res.code === 403){
                        top.location.href = baseUrl+"/";
                } else {
                    layer.msg(res.msg, {icon: 2});
                }
            }, 'json');
                }
            })
        });
    }